1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-05-05 06:27:53 +02:00
Barry vd. Heuvel 11896db266
Escape doctrine entries (#657)
* Escape doctrine entries

* Add PDO browsertest
2024-06-10 11:29:12 +02:00

39 lines
1.2 KiB
PHP

<?php
namespace DebugBar\Tests\Browser\Bridge;
use DebugBar\Browser\Bridge\WebDriverElement;
use DebugBar\Tests\Browser\AbstractBrowserTest;
class DoctrineTest extends AbstractBrowserTest
{
public function testMonologCollector(): void
{
if (!file_exists(__DIR__ . '/../../../../../demo/bridge/doctrine/vendor/autoload.php')) {
$this->markTestSkipped('Doctrine is not installed');
}
$client = static::createPantherClient();
$client->request('GET', '/demo/bridge/doctrine');
// Wait for Debugbar to load
$crawler = $client->waitFor('.phpdebugbar-body');
usleep(1000);
if (!$this->isTabActive($crawler, 'database')) {
$client->click($this->getTabLink($crawler, 'database'));
}
$crawler = $client->waitForVisibility('.phpdebugbar-panel[data-collector=database]');
$statements = $crawler->filter('.phpdebugbar-panel[data-collector=database] .phpdebugbar-widgets-sql')
->each(function($node){
return $node->getText();
});
$this->assertEquals('INSERT INTO products (name) VALUES (?)', $statements[1]);
$this->assertCount(4, $statements);
}
}