You are here

public function ResponseTest::testPrepareSetsPragmaOnHttp10Only 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::testPrepareSetsPragmaOnHttp10Only()

File

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

Class

ResponseTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testPrepareSetsPragmaOnHttp10Only() {
  $request = Request::create('/', 'GET');
  $request->server
    ->set('SERVER_PROTOCOL', 'HTTP/1.0');
  $response = new Response('foo');
  $response
    ->prepare($request);
  $this
    ->assertEquals('no-cache', $response->headers
    ->get('pragma'));
  $this
    ->assertEquals('-1', $response->headers
    ->get('expires'));
  $request->server
    ->set('SERVER_PROTOCOL', 'HTTP/1.1');
  $response = new Response('foo');
  $response
    ->prepare($request);
  $this
    ->assertFalse($response->headers
    ->has('pragma'));
  $this
    ->assertFalse($response->headers
    ->has('expires'));
}