You are here

public function SsiTest::testProcessRemoveSurrogateControlHeader in Zircon Profile 8

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

File

vendor/symfony/http-kernel/Tests/HttpCache/SsiTest.php, line 134

Class

SsiTest

Namespace

Symfony\Component\HttpKernel\Tests\HttpCache

Code

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