You are here

protected function PsrResponseSubscriberTest::createEvent in Drupal 9

Sets up an event that returns $controllerResult.

Parameters

mixed $controller_result: The return Object.

Return value

\Symfony\Component\HttpKernel\Event\ViewEvent A ViewEvent object to test.

2 calls to PsrResponseSubscriberTest::createEvent()
PsrResponseSubscriberTest::testConvertsControllerResult in core/tests/Drupal/Tests/Core/EventSubscriber/PsrResponseSubscriberTest.php
Tests altering and finished event.
PsrResponseSubscriberTest::testDoesNotConvertControllerResult in core/tests/Drupal/Tests/Core/EventSubscriber/PsrResponseSubscriberTest.php
Tests altering and finished event.

File

core/tests/Drupal/Tests/Core/EventSubscriber/PsrResponseSubscriberTest.php, line 84

Class

PsrResponseSubscriberTest
@coversDefaultClass \Drupal\Core\EventSubscriber\PsrResponseSubscriber @group EventSubscriber

Namespace

Drupal\Tests\Core\EventSubscriber

Code

protected function createEvent($controller_result) {
  return new ViewEvent($this
    ->createMock(HttpKernelInterface::class), $this
    ->createMock(Request::class), HttpKernelInterface::MASTER_REQUEST, $controller_result);
}