mirror of
https://github.com/maximebf/php-debugbar.git
synced 2025-07-25 18:51:42 +02:00
Add PDO browsertest
This commit is contained in:
34
tests/DebugBar/Tests/Browser/PdoTest.php
Normal file
34
tests/DebugBar/Tests/Browser/PdoTest.php
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user