You are here

public function ExceptionHandlerTest::testStatusCode in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/debug/Tests/ExceptionHandlerTest.php \Symfony\Component\Debug\Tests\ExceptionHandlerTest::testStatusCode()

File

vendor/symfony/debug/Tests/ExceptionHandlerTest.php, line 54

Class

ExceptionHandlerTest

Namespace

Symfony\Component\Debug\Tests

Code

public function testStatusCode() {
  $handler = new ExceptionHandler(false, 'iso8859-1');
  ob_start();
  $handler
    ->sendPhpResponse(new NotFoundHttpException('Foo'));
  $response = ob_get_clean();
  $this
    ->assertContains('Sorry, the page you are looking for could not be found.', $response);
  $expectedHeaders = array(
    array(
      'HTTP/1.0 404',
      true,
      null,
    ),
    array(
      'Content-Type: text/html; charset=iso8859-1',
      true,
      null,
    ),
  );
  $this
    ->assertSame($expectedHeaders, testHeader());
}