Пример #1
0
 public function testDisabledLogger()
 {
     $this->logger->enabled = false;
     $this->logger->startQuery('SELECT something FROM table');
     $this->assertEquals([], $this->logger->queries);
     $this->logger->stopQuery();
     $this->assertEquals([], $this->logger->queries);
 }
 public function testCollect()
 {
     $this->logger->startQuery('SELECT something FROM table');
     $this->logger->stopQuery();
     $this->collector->collect(new Request(), new Response());
     $this->assertEquals(1, $this->collector->getQueryCount());
     $this->assertEquals('SELECT something FROM table', $this->collector->getQueries()[1]['sql']);
     $this->assertEquals($this->logger->queries[1]['executionMS'], $this->collector->getTime());
 }