private function createCollector($queries) { $connection = $this->getMockBuilder('Doctrine\\DBAL\\Connection')->disableOriginalConstructor()->getMock(); $connection->expects($this->any())->method('getDatabasePlatform')->will($this->returnValue(new MySqlPlatform())); $registry = $this->getMock('Doctrine\\Common\\Persistence\\ManagerRegistry'); $registry->expects($this->any())->method('getConnectionNames')->will($this->returnValue(array('default' => 'doctrine.dbal.default_connection'))); $registry->expects($this->any())->method('getManagerNames')->will($this->returnValue(array('default' => 'doctrine.orm.default_entity_manager'))); $registry->expects($this->any())->method('getConnection')->will($this->returnValue($connection)); $logger = $this->getMock('Doctrine\\DBAL\\Logging\\DebugStack'); $logger->queries = $queries; $collector = new DoctrineDataCollector($registry); $collector->addLogger('default', $logger); return $collector; }