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(
36
36
return null ;
37
37
}
38
38
39
- // Make sure to handle only path and query
40
- $ previousUrl = $ parsed ['path ' ] ?? '' ;
41
- if (isset ($ parsed ['query ' ])) {
42
- $ previousUrl .= '? ' .$ parsed ['query ' ];
43
- }
44
-
45
39
try {
46
- $ newUrl = $ this ->createPath ($ previousUrl , $ pathMappedProps );
40
+ $ newUrl = $ this ->createPath ($ parsed [ ' path ' ] ?? '' , $ pathMappedProps );
47
41
} catch (ResourceNotFoundException |MethodNotAllowedException |MissingMandatoryParametersException ) {
48
42
return null ;
49
43
}
Original file line number Diff line number Diff line change @@ -41,10 +41,10 @@ public static function provideTestCreate(): \Generator
41
41
42
42
yield 'keep_url_with_query_parameters ' => [
43
43
'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 ' ,
45
45
'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 ' ,
48
48
],
49
49
];
50
50
@@ -62,6 +62,10 @@ public static function provideTestCreate(): \Generator
62
62
'queryMappedProps ' => ['prop1 ' => 'val1 ' , 'prop2 ' => 'val2 ' ],
63
63
],
64
64
'expectedUrl ' => '/foo/bar?prop1=val1&prop3=oldValue&prop2=val2 ' ,
65
+ 'routerStubData ' => [
66
+ 'previousUrl ' => '/foo/bar ' ,
67
+ 'newUrl ' => '/foo/bar ' ,
68
+ ],
65
69
];
66
70
67
71
yield 'add_path_parameters ' => [
You can’t perform that action at this time.
0 commit comments