You are here

public function HttpCacheTest::testDoesNotCacheSomeStatusCodeResponses in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/Tests/HttpCache/HttpCacheTest.php \Symfony\Component\HttpKernel\Tests\HttpCache\HttpCacheTest::testDoesNotCacheSomeStatusCodeResponses()

File

vendor/symfony/http-kernel/Tests/HttpCache/HttpCacheTest.php, line 377

Class

HttpCacheTest

Namespace

Symfony\Component\HttpKernel\Tests\HttpCache

Code

public function testDoesNotCacheSomeStatusCodeResponses() {
  foreach (array_merge(range(201, 202), range(204, 206), range(303, 305), range(400, 403), range(405, 409), range(411, 417), range(500, 505)) as $code) {
    $time = \DateTime::createFromFormat('U', time() + 5);
    $this
      ->setNextResponse($code, array(
      'Expires' => $time
        ->format(DATE_RFC2822),
    ));
    $this
      ->request('GET', '/');
    $this
      ->assertEquals($code, $this->response
      ->getStatusCode());
    $this
      ->assertTraceNotContains('store');
    $this
      ->assertFalse($this->response->headers
      ->has('Age'));
  }
}