You are here

public function EsiTest::testHasSurrogateEsiCapability 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::testHasSurrogateEsiCapability()

File

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

Class

EsiTest

Namespace

Symfony\Component\HttpKernel\Tests\HttpCache

Code

public function testHasSurrogateEsiCapability() {
  $esi = new Esi();
  $request = Request::create('/');
  $request->headers
    ->set('Surrogate-Capability', 'abc="ESI/1.0"');
  $this
    ->assertTrue($esi
    ->hasSurrogateCapability($request));
  $request = Request::create('/');
  $request->headers
    ->set('Surrogate-Capability', 'foobar');
  $this
    ->assertFalse($esi
    ->hasSurrogateCapability($request));
  $request = Request::create('/');
  $this
    ->assertFalse($esi
    ->hasSurrogateCapability($request));
}