protected function AnonymousLoginSubscriberTest::getGetResponseEventStub in Anonymous login 8
Same name and namespace in other branches
- 8.2 tests/src/Unit/AnonymousLoginSubscriberTest.php \Drupal\Tests\anonymous_login\Unit\AnonymousLoginSubscriberTest::getGetResponseEventStub()
Gets response event object.
Parameters
string $request_uri: The URI of the request.
Return value
\Symfony\Component\HttpKernel\Event\GetResponseEvent The get response event object.
1 call to AnonymousLoginSubscriberTest::getGetResponseEventStub()
- AnonymousLoginSubscriberTest::callOnKernelRequestCheckRedirect in tests/
src/ Unit/ AnonymousLoginSubscriberTest.php - Instantiates the subscriber and runs redirect().
File
- tests/
src/ Unit/ AnonymousLoginSubscriberTest.php, line 220
Class
- AnonymousLoginSubscriberTest
- Tests the redirect logic.
Namespace
Drupal\Tests\anonymous_login\UnitCode
protected function getGetResponseEventStub($request_uri) {
$request = Request::create($request_uri, 'GET', [], [], [], [
'SCRIPT_NAME' => 'index.php',
]);
$http_kernel = $this
->getMockBuilder('\\Symfony\\Component\\HttpKernel\\HttpKernelInterface')
->getMock();
return new GetResponseEvent($http_kernel, $request, 'test');
}