public function StreamedResponseTest::testPrepareWith11Protocol

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/StreamedResponseTest.php, line 27

Class

StreamedResponseTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testPrepareWith11Protocol() {
  $response = new StreamedResponse(function () {
    echo 'foo';
  });
  $request = Request::create('/');
  $request->server
    ->set('SERVER_PROTOCOL', 'HTTP/1.1');
  $response
    ->prepare($request);
  $this
    ->assertEquals('1.1', $response
    ->getProtocolVersion());
  $this
    ->assertNotEquals('chunked', $response->headers
    ->get('Transfer-Encoding'), 'Apache assumes responses with a Transfer-Encoding header set to chunked to already be encoded.');
  $this
    ->assertEquals('no-cache, private', $response->headers
    ->get('Cache-Control'));
}