You are here

protected function DomainRedirectRequestSubscriberTest::getGetResponseEventStub in Redirect 8

Gets response event object.

Parameters

$path_info: The path info.

$query_string: The query string in the url.

Return value

GetResponseEvent The response for the request.

1 call to DomainRedirectRequestSubscriberTest::getGetResponseEventStub()
DomainRedirectRequestSubscriberTest::testDomainRedirect in modules/redirect_domain/tests/src/Unit/DomainRedirectRequestSubscriberTest.php
Tests redirect between domains.

File

modules/redirect_domain/tests/src/Unit/DomainRedirectRequestSubscriberTest.php, line 134

Class

DomainRedirectRequestSubscriberTest
Tests the redirect logic.

Namespace

Drupal\Tests\redirect_domain\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(HttpKernelInterface::class)
    ->getMock();
  return new GetResponseEvent($http_kernel, $request, HttpKernelInterface::MASTER_REQUEST);
}