You are here

public function ExceptionListenerTest::testHandleWithoutLogger in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/Tests/EventListener/ExceptionListenerTest.php \Symfony\Component\HttpKernel\Tests\EventListener\ExceptionListenerTest::testHandleWithoutLogger()

@dataProvider provider

File

vendor/symfony/http-kernel/Tests/EventListener/ExceptionListenerTest.php, line 46

Class

ExceptionListenerTest
ExceptionListenerTest.

Namespace

Symfony\Component\HttpKernel\Tests\EventListener

Code

public function testHandleWithoutLogger($event, $event2) {
  $this
    ->iniSet('error_log', file_exists('/dev/null') ? '/dev/null' : 'nul');
  $l = new ExceptionListener('foo');
  $l
    ->onKernelException($event);
  $this
    ->assertEquals(new Response('foo'), $event
    ->getResponse());
  try {
    $l
      ->onKernelException($event2);
    $this
      ->fail('RuntimeException expected');
  } catch (\RuntimeException $e) {
    $this
      ->assertSame('bar', $e
      ->getMessage());
    $this
      ->assertSame('foo', $e
      ->getPrevious()
      ->getMessage());
  }
}