File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -36,14 +36,8 @@ public function createFromPreviousAndProps(
3636 return null ;
3737 }
3838
39- // Make sure to handle only path and query
40- $ previousUrl = $ parsed ['path ' ] ?? '' ;
41- if (isset ($ parsed ['query ' ])) {
42- $ previousUrl .= '? ' .$ parsed ['query ' ];
43- }
44-
4539 try {
46- $ newUrl = $ this ->createPath ($ previousUrl , $ pathMappedProps );
40+ $ newUrl = $ this ->createPath ($ parsed [ ' path ' ] ?? '' , $ pathMappedProps );
4741 } catch (ResourceNotFoundException |MethodNotAllowedException |MissingMandatoryParametersException ) {
4842 return null ;
4943 }
Original file line number Diff line number Diff line change @@ -41,10 +41,10 @@ public static function provideTestCreate(): \Generator
4141
4242 yield 'keep_url_with_query_parameters ' => [
4343 'input ' => ['previousUrl ' => 'https://symfony.com/foo/bar?prop1=val1&prop2=val2 ' ],
44- '/foo/bar?prop1=val1&prop2=val2 ' ,
44+ 'expectedUrl ' => ' /foo/bar?prop1=val1&prop2=val2 ' ,
4545 'routerStubData ' => [
46- 'previousUrl ' => '/foo/bar?prop1=val1&prop2=val2 ' ,
47- 'newUrl ' => '/foo/bar?prop1=val1&prop2=val2 ' ,
46+ 'previousUrl ' => '/foo/bar ' ,
47+ 'newUrl ' => '/foo/bar ' ,
4848 ],
4949 ];
5050
@@ -62,6 +62,10 @@ public static function provideTestCreate(): \Generator
6262 'queryMappedProps ' => ['prop1 ' => 'val1 ' , 'prop2 ' => 'val2 ' ],
6363 ],
6464 'expectedUrl ' => '/foo/bar?prop1=val1&prop3=oldValue&prop2=val2 ' ,
65+ 'routerStubData ' => [
66+ 'previousUrl ' => '/foo/bar ' ,
67+ 'newUrl ' => '/foo/bar ' ,
68+ ],
6569 ];
6670
6771 yield 'add_path_parameters ' => [
You can’t perform that action at this time.
0 commit comments