You are here

public function FragmentListenerTest::testOnlyTriggeredIfControllerWasNotDefinedYet in Zircon Profile 8

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

File

vendor/symfony/http-kernel/Tests/EventListener/FragmentListenerTest.php, line 37

Class

FragmentListenerTest

Namespace

Symfony\Component\HttpKernel\Tests\EventListener

Code

public function testOnlyTriggeredIfControllerWasNotDefinedYet() {
  $request = Request::create('http://example.com/_fragment?_path=foo%3Dbar%26_controller%3Dfoo');
  $request->attributes
    ->set('_controller', 'bar');
  $listener = new FragmentListener(new UriSigner('foo'));
  $event = $this
    ->createGetResponseEvent($request, HttpKernelInterface::SUB_REQUEST);
  $expected = $request->attributes
    ->all();
  $listener
    ->onKernelRequest($event);
  $this
    ->assertEquals($expected, $request->attributes
    ->all());
}