Skip to content

Commit

Permalink
test: add test cases for routes with integer
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Jun 12, 2024
1 parent ce3750c commit 042525c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/system/Router/DefinedRouteCollectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ public function testCollect(): void
{
$routes = $this->createRouteCollection();
$routes->get('journals', 'Blogs');
$routes->get('100', 'Home::index');
$routes->get('product/(:num)', 'Catalog::productLookupByID/$1');
$routes->get('feed', static fn () => 'A Closure route.');
$routes->get('200', static fn () => 'A Closure route.');
$routes->view('about', 'pages/about');

$collector = new DefinedRouteCollector($routes);
Expand All @@ -69,6 +71,12 @@ public function testCollect(): void
'name' => 'journals',
'handler' => '\App\Controllers\Blogs',
],
[
'method' => 'GET',
'route' => '100',
'name' => '100',
'handler' => '\App\Controllers\Home::index',
],
[
'method' => 'GET',
'route' => 'product/([0-9]+)',
Expand All @@ -81,6 +89,12 @@ public function testCollect(): void
'name' => 'feed',
'handler' => '(Closure)',
],
[
'method' => 'GET',
'route' => '200',
'name' => '200',
'handler' => '(Closure)',
],
[
'method' => 'GET',
'route' => 'about',
Expand Down

0 comments on commit 042525c

Please sign in to comment.