public function RouteNormalizerRequestSubscriberTest::testOnKernelRequestRedirect in Redirect 8
@covers ::onKernelRequestRedirect @dataProvider getTestUrls
File
- tests/
src/ Unit/ RouteNormalizerRequestSubscriberTest.php, line 83
Class
- RouteNormalizerRequestSubscriberTest
- Tests the route normalizer.
Namespace
Drupal\Tests\redirect\UnitCode
public function testOnKernelRequestRedirect($request_uri, $request_query, $expected, $expect_normalization) {
$event = $this
->getGetResponseEventStub($request_uri, http_build_query($request_query));
$subscriber = $this
->getSubscriber($request_uri);
$subscriber
->onKernelRequestRedirect($event);
if ($expect_normalization) {
$response = $event
->getResponse();
$this
->assertEquals($expected, $response
->getTargetUrl());
}
}