Skip to content

Commit 042525c

Browse files
committed
test: add test cases for routes with integer
1 parent ce3750c commit 042525c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/system/Router/DefinedRouteCollectorTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ public function testCollect(): void
5050
{
5151
$routes = $this->createRouteCollection();
5252
$routes->get('journals', 'Blogs');
53+
$routes->get('100', 'Home::index');
5354
$routes->get('product/(:num)', 'Catalog::productLookupByID/$1');
5455
$routes->get('feed', static fn () => 'A Closure route.');
56+
$routes->get('200', static fn () => 'A Closure route.');
5557
$routes->view('about', 'pages/about');
5658

5759
$collector = new DefinedRouteCollector($routes);
@@ -69,6 +71,12 @@ public function testCollect(): void
6971
'name' => 'journals',
7072
'handler' => '\App\Controllers\Blogs',
7173
],
74+
[
75+
'method' => 'GET',
76+
'route' => '100',
77+
'name' => '100',
78+
'handler' => '\App\Controllers\Home::index',
79+
],
7280
[
7381
'method' => 'GET',
7482
'route' => 'product/([0-9]+)',
@@ -81,6 +89,12 @@ public function testCollect(): void
8189
'name' => 'feed',
8290
'handler' => '(Closure)',
8391
],
92+
[
93+
'method' => 'GET',
94+
'route' => '200',
95+
'name' => '200',
96+
'handler' => '(Closure)',
97+
],
8498
[
8599
'method' => 'GET',
86100
'route' => 'about',

0 commit comments

Comments
 (0)