1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-07-27 19:50:21 +02:00
Files
php-debugbar/tests/DebugBar/Tests/Browser/PdoTest.php
Barry vd. Heuvel 11896db266 Escape doctrine entries (#657)
* Escape doctrine entries

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

34 lines
980 B
PHP

<?php
namespace DebugBar\Tests\Browser;
use DebugBar\Browser\Bridge\WebDriverElement;
class PdoTest extends AbstractBrowserTest
{
public function testMonologCollector(): void
{
$client = static::createPantherClient();
$client->request('GET', '/demo/pdo.php');
// 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 users (name) values (?)', $statements[1]);
$this->assertCount(7, $statements);
}
}