public function LoggerDataCollectorTest::testCollect

@dataProvider getCollectTestData

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php, line 30

Class

LoggerDataCollectorTest

Namespace

Symfony\Component\HttpKernel\Tests\DataCollector

Code

public function testCollect($nb, $logs, $expected) {
  $logger = $this
    ->getMock('Symfony\\Component\\HttpKernel\\Log\\DebugLoggerInterface');
  $logger
    ->expects($this
    ->once())
    ->method('countErrors')
    ->will($this
    ->returnValue($nb));
  $logger
    ->expects($this
    ->once())
    ->method('getLogs')
    ->will($this
    ->returnValue($logs));
  $c = new LoggerDataCollector($logger);
  $c
    ->collect(new Request(), new Response());
  $this
    ->assertSame('logger', $c
    ->getName());
  $this
    ->assertSame($nb, $c
    ->countErrors());
  $this
    ->assertSame($expected ? $expected : $logs, $c
    ->getLogs());
}