@@ 20-34 (lines=15) @@ | ||
17 | * @dataProvider configProvider |
|
18 | * @param array $config |
|
19 | */ |
|
20 | public function testTrailingSlashRedirect(array $config) |
|
21 | { |
|
22 | $request = $this->getFooRequest(); |
|
23 | $event = $this->getGetResponseForExceptionEvent($request); |
|
24 | ||
25 | $listener = $this->getListener($config); |
|
26 | ||
27 | $listener->onKernelException($event); |
|
28 | ||
29 | /** @var RedirectResponse $response */ |
|
30 | $response = $event->getResponse(); |
|
31 | ||
32 | $this->assertTrue($response instanceof RedirectResponse); |
|
33 | $this->assertEquals('https://example.org/foo', $response->getTargetUrl()); |
|
34 | } |
|
35 | ||
36 | /** |
|
37 | * @dataProvider configProvider |
|
@@ 95-109 (lines=15) @@ | ||
92 | * @dataProvider configProvider |
|
93 | * @param array $config |
|
94 | */ |
|
95 | public function testRouteWithUrlParametersAndTrailingSlashRedirectsToCorrectRoute(array $config) |
|
96 | { |
|
97 | $request = Request::create('https://example.org/foo/bar/'); |
|
98 | $event = $this->getGetResponseForExceptionEvent($request); |
|
99 | ||
100 | $listener = $this->getListener($config); |
|
101 | ||
102 | $listener->onKernelException($event); |
|
103 | ||
104 | /** @var RedirectResponse $response */ |
|
105 | $response = $event->getResponse(); |
|
106 | ||
107 | $this->assertInstanceOf(RedirectResponse::class, $response); |
|
108 | $this->assertEquals('https://example.org/foo/bar', $response->getTargetUrl()); |
|
109 | } |
|
110 | ||
111 | /** |
|
112 | * @param Request $request |