public function HttpCacheTest::testEsiCacheRemoveValidationHeadersIfEmbeddedResponses

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php, line 1079

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());
}