public function ExceptionHandlerTest::testDebug

File

drupal/core/vendor/symfony/debug/Symfony/Component/Debug/Tests/ExceptionHandlerTest.php, line 27

Class

ExceptionHandlerTest

Namespace

Symfony\Component\Debug\Tests

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());
}