You are here

public function ResponseTest::testPrepareRemovesContentLength in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Tests/ResponseTest.php \Symfony\Component\HttpFoundation\Tests\ResponseTest::testPrepareRemovesContentLength()

File

vendor/symfony/http-foundation/Tests/ResponseTest.php, line 528

Class

ResponseTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testPrepareRemovesContentLength() {
  $response = new Response('foo');
  $request = Request::create('/');
  $response->headers
    ->set('Content-Length', 12345);
  $response
    ->prepare($request);
  $this
    ->assertEquals(12345, $response->headers
    ->get('Content-Length'));
  $response->headers
    ->set('Transfer-Encoding', 'chunked');
  $response
    ->prepare($request);
  $this
    ->assertFalse($response->headers
    ->has('Content-Length'));
}