3 namespace Doctrine\Tests\DBAL\Logging;
5 require_once __DIR__ . '/../../TestInit.php';
7 class DebugStackTest extends \Doctrine\Tests\DbalTestCase
9 public function setUp()
11 $this->logger = new \Doctrine\DBAL\Logging\DebugStack();
14 public function tearDown()
19 public function testLoggedQuery()
21 $this->logger->startQuery('SELECT column FROM table');
25 'sql' => 'SELECT column FROM table',
31 $this->logger->queries
34 $this->logger->stopQuery();
35 $this->assertGreaterThan(0, $this->logger->queries[1]['executionMS']);
38 public function testLoggedQueryDisabled()
40 $this->logger->enabled = false;
41 $this->logger->startQuery('SELECT column FROM table');
42 $this->assertEquals(array(), $this->logger->queries);
44 $this->logger->stopQuery();
45 $this->assertEquals(array(), $this->logger->queries);