public function LoggerDataCollectorTest::testCollect in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/http-kernel/Tests/DataCollector/LoggerDataCollectorTest.php \Symfony\Component\HttpKernel\Tests\DataCollector\LoggerDataCollectorTest::testCollect()
@dataProvider getCollectTestData
File
- vendor/
symfony/ http-kernel/ Tests/ DataCollector/ LoggerDataCollectorTest.php, line 21
Class
Namespace
Symfony\Component\HttpKernel\Tests\DataCollectorCode
public function testCollect($nb, $logs, $expectedLogs, $expectedDeprecationCount, $expectedScreamCount, $expectedPriorities = null) {
$logger = $this
->getMock('Symfony\\Component\\HttpKernel\\Log\\DebugLoggerInterface');
$logger
->expects($this
->once())
->method('countErrors')
->will($this
->returnValue($nb));
$logger
->expects($this
->exactly(2))
->method('getLogs')
->will($this
->returnValue($logs));
$c = new LoggerDataCollector($logger);
$c
->lateCollect();
$this
->assertSame('logger', $c
->getName());
$this
->assertSame($nb, $c
->countErrors());
$this
->assertSame($expectedLogs ?: $logs, $c
->getLogs());
$this
->assertSame($expectedDeprecationCount, $c
->countDeprecations());
$this
->assertSame($expectedScreamCount, $c
->countScreams());
if (isset($expectedPriorities)) {
$this
->assertSame($expectedPriorities, $c
->getPriorities());
}
}