@@ -22,7 +22,7 @@ public function test_route_with_optional_parameter_matches_both_paths(): void
2222 $ tree = new RoutingTree ();
2323
2424 $ markedRoute = $ routeBuilder
25- ->withUri ('/users/{id? } ' )
25+ ->withUri ('/users/{?id } ' )
2626 ->withHandler ('handlerWithOptionalId ' )
2727 ->asMarkedRoute ('a ' );
2828
@@ -43,12 +43,12 @@ public function test_route_with_optional_parameter_matches_both_paths(): void
4343
4444 $ matchedWithoutParam = $ matcher ->match (new GenericRequest (Method::GET , '/users ' ));
4545 $ this ->assertNotNull ($ matchedWithoutParam );
46- $ this ->assertEquals ('/users/{id? } ' , $ matchedWithoutParam ->route ->uri );
46+ $ this ->assertEquals ('/users/{?id } ' , $ matchedWithoutParam ->route ->uri );
4747 $ this ->assertEquals (['id ' => 'default-id ' ], $ matchedWithoutParam ->params );
4848
4949 $ matchedWithParam = $ matcher ->match (new GenericRequest (Method::GET , '/users/123 ' ));
5050 $ this ->assertNotNull ($ matchedWithParam );
51- $ this ->assertEquals ('/users/{id? } ' , $ matchedWithParam ->route ->uri );
51+ $ this ->assertEquals ('/users/{?id } ' , $ matchedWithParam ->route ->uri );
5252 $ this ->assertEquals (['id ' => '123 ' ], $ matchedWithParam ->params );
5353 }
5454
@@ -58,7 +58,7 @@ public function test_route_with_multiple_optional_parameters(): void
5858 $ tree = new RoutingTree ();
5959
6060 $ markedRoute = $ routeBuilder
61- ->withUri ('/posts/{id? }/{slug? } ' )
61+ ->withUri ('/posts/{?id }/{?slug } ' )
6262 ->withHandler ('handlerWithTwoOptionalParams ' )
6363 ->asMarkedRoute ('a ' );
6464
@@ -96,7 +96,7 @@ public function test_route_with_required_and_optional_parameters(): void
9696 $ tree = new RoutingTree ();
9797
9898 $ markedRoute = $ routeBuilder
99- ->withUri ('/posts/{id}/{slug? } ' )
99+ ->withUri ('/posts/{id}/{?slug } ' )
100100 ->withHandler ('handlerWithRequiredAndOptional ' )
101101 ->asMarkedRoute ('a ' );
102102
@@ -130,7 +130,7 @@ public function test_route_with_optional_parameter_and_custom_regex(): void
130130 $ tree = new RoutingTree ();
131131
132132 $ markedRoute = $ routeBuilder
133- ->withUri ('/users/{id? :\d+} ' )
133+ ->withUri ('/users/{?id :\d+} ' )
134134 ->withHandler ('handlerWithOptionalId ' )
135135 ->asMarkedRoute ('a ' );
136136
@@ -166,7 +166,7 @@ public function test_optional_parameters_are_parsed_correctly(): void
166166 $ routeBuilder = new FakeRouteBuilderWithOptionalParams ();
167167
168168 $ route = $ routeBuilder
169- ->withUri ('/users/{id? } ' )
169+ ->withUri ('/users/{?id } ' )
170170 ->withHandler ('handlerWithOptionalId ' )
171171 ->asDiscoveredRoute ();
172172
@@ -179,7 +179,7 @@ public function test_mixed_optional_and_required_parameters_are_parsed_correctly
179179 $ routeBuilder = new FakeRouteBuilderWithOptionalParams ();
180180
181181 $ route = $ routeBuilder
182- ->withUri ('/posts/{id}/{slug? } ' )
182+ ->withUri ('/posts/{id}/{?slug } ' )
183183 ->withHandler ('handlerWithRequiredAndOptional ' )
184184 ->asDiscoveredRoute ();
185185
0 commit comments