public function ExceptionHandlerTest::testDebug

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/Debug/ExceptionHandlerTest.php, line 27

Class

ExceptionHandlerTest

Namespace

Symfony\Component\HttpKernel\Tests\Debug

Code

public function testDebug() {
  $handler = new ExceptionHandler(false);
  $response = $handler
    ->createResponse(new \RuntimeException('Foo'));
  $this
    ->assertContains('<h1>Whoops, looks like something went wrong.</h1>', $response
    ->getContent());
  $this
    ->assertNotContains('<div class="block_exception clear_fix">', $response
    ->getContent());
  $handler = new ExceptionHandler(true);
  $response = $handler
    ->createResponse(new \RuntimeException('Foo'));
  $this
    ->assertContains('<h1>Whoops, looks like something went wrong.</h1>', $response
    ->getContent());
  $this
    ->assertContains('<div class="block_exception clear_fix">', $response
    ->getContent());
}