You are here

public function ExceptionHandlerTest::testHeaders in Zircon Profile 8.0

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

File

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

Class

ExceptionHandlerTest

Namespace

Symfony\Component\Debug\Tests

Code

public function testHeaders() {
  $handler = new ExceptionHandler(false, 'iso8859-1');
  ob_start();
  $handler
    ->sendPhpResponse(new MethodNotAllowedHttpException(array(
    'POST',
  )));
  $response = ob_get_clean();
  $expectedHeaders = array(
    array(
      'HTTP/1.0 405',
      true,
      null,
    ),
    array(
      'Allow: POST',
      false,
      null,
    ),
    array(
      'Content-Type: text/html; charset=iso8859-1',
      true,
      null,
    ),
  );
  $this
    ->assertSame($expectedHeaders, testHeader());
}