You are here

protected function PsrResponseSubscriberTest::createEvent in Drupal 10

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/EventSubscriber/PsrResponseSubscriberTest.php \Drupal\Tests\Core\EventSubscriber\PsrResponseSubscriberTest::createEvent()

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::MAIN_REQUEST, $controller_result);
}