You are here

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

File

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

Class

HttpCacheTest

Namespace

Symfony\Component\HttpKernel\Tests\HttpCache

Code

public function testEsiCacheRemoveValidationHeadersIfEmbeddedResponses() {
  $time = new \DateTime();
  $responses = array(
    array(
      'status' => 200,
      'body' => '<esi:include src="/hey" />',
      'headers' => array(
        'Surrogate-Control' => 'content="ESI/1.0"',
        'ETag' => 'hey',
        'Last-Modified' => $time
          ->format(DATE_RFC2822),
      ),
    ),
    array(
      'status' => 200,
      'body' => 'Hey!',
      'headers' => array(),
    ),
  );
  $this
    ->setNextResponses($responses);
  $this
    ->request('GET', '/', array(), array(), true);
  $this
    ->assertNull($this->response
    ->getETag());
  $this
    ->assertNull($this->response
    ->getLastModified());
}