You are here

protected function RedirectRequestSubscriberTest::getGetResponseEventStub in Redirect 8

Gets response event object.

Parameters

$path_info:

$query_string:

Return value

GetResponseEvent

1 call to RedirectRequestSubscriberTest::getGetResponseEventStub()
RedirectRequestSubscriberTest::callOnKernelRequestCheckRedirect in tests/src/Unit/RedirectRequestSubscriberTest.php
Instantiates the subscriber and runs onKernelRequestCheckRedirect()

File

tests/src/Unit/RedirectRequestSubscriberTest.php, line 278

Class

RedirectRequestSubscriberTest
Tests the redirect logic.

Namespace

Drupal\Tests\redirect\Unit

Code

protected function getGetResponseEventStub($path_info, $query_string) {
  $request = Request::create($path_info . '?' . $query_string, 'GET', [], [], [], [
    'SCRIPT_NAME' => 'index.php',
  ]);
  $http_kernel = $this
    ->getMockBuilder('\\Symfony\\Component\\HttpKernel\\HttpKernelInterface')
    ->getMock();
  return new GetResponseEvent($http_kernel, $request, HttpKernelInterface::MASTER_REQUEST);
}