You are here

public function SurrogateListenerTest::testFilterWhenThereIsNoEsiIncludes in Zircon Profile 8

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

File

vendor/symfony/http-kernel/Tests/EventListener/SurrogateListenerTest.php, line 53

Class

SurrogateListenerTest

Namespace

Symfony\Component\HttpKernel\Tests\EventListener

Code

public function testFilterWhenThereIsNoEsiIncludes() {
  $dispatcher = new EventDispatcher();
  $kernel = $this
    ->getMock('Symfony\\Component\\HttpKernel\\HttpKernelInterface');
  $response = new Response('foo');
  $listener = new SurrogateListener(new Esi());
  $dispatcher
    ->addListener(KernelEvents::RESPONSE, array(
    $listener,
    'onKernelResponse',
  ));
  $event = new FilterResponseEvent($kernel, new Request(), HttpKernelInterface::MASTER_REQUEST, $response);
  $dispatcher
    ->dispatch(KernelEvents::RESPONSE, $event);
  $this
    ->assertEquals('', $event
    ->getResponse()->headers
    ->get('Surrogate-Control'));
}