@@ -220,9 +220,9 @@ public function pathQueryParamsProvider()
220
220
return [
221
221
['http://www.example.com/base/redirect-path ' , '/redirect-path ' , '' ],
222
222
['http://www.example.com/base/redirect-path?foo=bar ' , '/redirect-path?foo=bar ' , '' ],
223
- ['http://www.example.com/base/redirect-path?foo =bar ' , '/redirect-path ' , 'foo =bar ' ],
224
- ['http://www.example.com/base/redirect-path?foo =bar&abc =example ' , '/redirect-path?foo =bar ' , 'abc =example ' ],
225
- ['http://www.example.com/base/redirect-path?foo =bar&abc =example&baz =def ' , '/redirect-path?foo =bar ' , 'abc =example&baz =def ' ],
223
+ ['http://www.example.com/base/redirect-path?f.o =bar ' , '/redirect-path ' , 'f.o =bar ' ],
224
+ ['http://www.example.com/base/redirect-path?f.o =bar&a.c =example ' , '/redirect-path?f.o =bar ' , 'a.c =example ' ],
225
+ ['http://www.example.com/base/redirect-path?f.o =bar&a.c =example&b.z =def ' , '/redirect-path?f.o =bar ' , 'a.c =example&b.z =def ' ],
226
226
];
227
227
}
228
228
@@ -246,29 +246,20 @@ public function testPathQueryParams($expectedUrl, $path, $queryString)
246
246
247
247
private function createRequestObject ($ scheme , $ host , $ port , $ baseUrl , $ queryString = '' )
248
248
{
249
- $ request = $ this ->getMockBuilder ('Symfony\Component\HttpFoundation\Request ' )->getMock ();
250
- $ request
251
- ->expects ($ this ->any ())
252
- ->method ('getScheme ' )
253
- ->willReturn ($ scheme );
254
- $ request
255
- ->expects ($ this ->any ())
256
- ->method ('getHost ' )
257
- ->willReturn ($ host );
258
- $ request
259
- ->expects ($ this ->any ())
260
- ->method ('getPort ' )
261
- ->willReturn ($ port );
262
- $ request
263
- ->expects ($ this ->any ())
264
- ->method ('getBaseUrl ' )
265
- ->willReturn ($ baseUrl );
266
- $ request
267
- ->expects ($ this ->any ())
268
- ->method ('getQueryString ' )
269
- ->willReturn ($ queryString );
270
-
271
- return $ request ;
249
+ if ('' !== $ queryString ) {
250
+ parse_str ($ queryString , $ query );
251
+ } else {
252
+ $ query = [];
253
+ }
254
+
255
+ return new Request ($ query , [], [], [], [], [
256
+ 'HTTPS ' => 'https ' === $ scheme ,
257
+ 'HTTP_HOST ' => $ host .($ port ? ': ' .$ port : '' ),
258
+ 'SERVER_PORT ' => $ port ,
259
+ 'SCRIPT_FILENAME ' => $ baseUrl ,
260
+ 'REQUEST_URI ' => $ baseUrl ,
261
+ 'QUERY_STRING ' => $ queryString ,
262
+ ]);
272
263
}
273
264
274
265
private function createRedirectController ($ httpPort = null , $ httpsPort = null )
0 commit comments