You are here

public function EsiTest::testProcessRemoveSurrogateControlHeader in Zircon Profile 8

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

File

vendor/symfony/http-kernel/Tests/HttpCache/EsiTest.php, line 167

Class

EsiTest

Namespace

Symfony\Component\HttpKernel\Tests\HttpCache

Code

public function testProcessRemoveSurrogateControlHeader() {
  $esi = new Esi();
  $request = Request::create('/');
  $response = new Response('foo <esi:include src="..." />');
  $response->headers
    ->set('Surrogate-Control', 'content="ESI/1.0"');
  $esi
    ->process($request, $response);
  $this
    ->assertEquals('ESI', $response->headers
    ->get('x-body-eval'));
  $response->headers
    ->set('Surrogate-Control', 'no-store, content="ESI/1.0"');
  $esi
    ->process($request, $response);
  $this
    ->assertEquals('ESI', $response->headers
    ->get('x-body-eval'));
  $this
    ->assertEquals('no-store', $response->headers
    ->get('surrogate-control'));
  $response->headers
    ->set('Surrogate-Control', 'content="ESI/1.0", no-store');
  $esi
    ->process($request, $response);
  $this
    ->assertEquals('ESI', $response->headers
    ->get('x-body-eval'));
  $this
    ->assertEquals('no-store', $response->headers
    ->get('surrogate-control'));
}