You are here

public function HttpCacheTest::testStoresResponsesWhenNoCacheRequestDirectivePresent 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::testStoresResponsesWhenNoCacheRequestDirectivePresent()

File

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

Class

HttpCacheTest

Namespace

Symfony\Component\HttpKernel\Tests\HttpCache

Code

public function testStoresResponsesWhenNoCacheRequestDirectivePresent() {
  $time = \DateTime::createFromFormat('U', time() + 5);
  $this
    ->setNextResponse(200, array(
    'Cache-Control' => 'public',
    'Expires' => $time
      ->format(DATE_RFC2822),
  ));
  $this
    ->request('GET', '/', array(
    'HTTP_CACHE_CONTROL' => 'no-cache',
  ));
  $this
    ->assertHttpKernelIsCalled();
  $this
    ->assertTraceContains('store');
  $this
    ->assertTrue($this->response->headers
    ->has('Age'));
}