Skip to content

Commit 4142b50

Browse files
authored
fix: routes keys must not be its names
1 parent 702d326 commit 4142b50

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/system/Router/RouteCollectionTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,22 @@ public function testNamedRoutesWithPipesInRegex(): void
11051105
$this->assertSame('/system/that', $routes->reverseRoute('pipedRoute', 'that'));
11061106
}
11071107

1108+
public function testNamedRouteAsPath(): void
1109+
{
1110+
service('request')->setMethod(Method::GET);
1111+
$routes = $this->getCollector();
1112+
1113+
$expected = [
1114+
'here' => '\there',
1115+
'from' => '\to',
1116+
];
1117+
1118+
$routes->get('here', 'there');
1119+
$routes->get('from', 'to', ['as' => 'here']);
1120+
1121+
$this->assertSame($expected, $routes->getRoutes());
1122+
}
1123+
11081124
public function testAddRedirect(): void
11091125
{
11101126
$routes = $this->getCollector();

0 commit comments

Comments
 (0)