You are here

protected function RouteNameResponseSubscriberTest::buildEvent in Page Manager 8

Same name and namespace in other branches
  1. 8.4 tests/src/Unit/RouteNameResponseSubscriberTest.php \Drupal\Tests\page_manager\Unit\RouteNameResponseSubscriberTest::buildEvent()

Builds an event to wrap a response.

Parameters

\Symfony\Component\HttpFoundation\Response $response: The response to be sent as the event payload.

Return value

\Symfony\Component\HttpKernel\Event\FilterResponseEvent An event suitable for a KernelEvents::RESPONSE subscriber to process.

3 calls to RouteNameResponseSubscriberTest::buildEvent()
RouteNameResponseSubscriberTest::testOnResponseCacheable in tests/src/Unit/RouteNameResponseSubscriberTest.php
@covers ::onResponse
RouteNameResponseSubscriberTest::testOnResponseCacheableWithBaseRouteName in tests/src/Unit/RouteNameResponseSubscriberTest.php
@covers ::onResponse
RouteNameResponseSubscriberTest::testOnResponseUncacheable in tests/src/Unit/RouteNameResponseSubscriberTest.php
@covers ::onResponse

File

tests/src/Unit/RouteNameResponseSubscriberTest.php, line 94
Contains \Drupal\Tests\page_manager\Unit\RouteNameResponseSubscriberTest.

Class

RouteNameResponseSubscriberTest
@coversDefaultClass \Drupal\page_manager\EventSubscriber\RouteNameResponseSubscriber @group PageManager

Namespace

Drupal\Tests\page_manager\Unit

Code

protected function buildEvent(Response $response) {
  $kernel = $this
    ->prophesize(HttpKernelInterface::class);
  $request = Request::create('');
  return new FilterResponseEvent($kernel
    ->reveal(), $request, HttpKernelInterface::SUB_REQUEST, $response);
}