We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
testRouteParametersDefaultValue
1 parent 64c3b2a commit 433fd15Copy full SHA for 433fd15
tests/Routing/RoutingRouteTest.php
@@ -867,6 +867,23 @@ public function testRouterPatternSetting(): void
867
}
868
869
870
+ public function testRouteParametersDefaultValue()
871
+ {
872
+ $router = $this->getRouter();
873
+
874
+ $router->get('foo/{bar?}', function ($bar = '') {
875
+ return $bar;
876
+ })->defaults('bar', 'foo');
877
+ $this->assertEquals('foo', $router->dispatch(Request::create('foo', 'GET'))->getContent());
878
879
880
881
882
883
+ $this->assertEquals('bar', $router->dispatch(Request::create('foo/bar', 'GET'))->getContent());
884
+ }
885
886
887
public function testRouteRedirect()
888
{
889
$router = $this->getRouter();
0 commit comments