1212namespace CodeIgniter \Router ;
1313
1414use CodeIgniter \Config \Services ;
15- use CodeIgniter \controller ;
1615use CodeIgniter \Exceptions \PageNotFoundException ;
1716use CodeIgniter \Test \CIUnitTestCase ;
1817use Config \Modules ;
@@ -89,7 +88,7 @@ public function testBasicAddCallableWithParamsString()
8988
9089 $ routes = $ routes ->getRoutes ();
9190 $ expects = [
92- 'product/(\d +)/(\d +) ' => '\Tests\Support\Controllers\Hello::index/$2/$1 ' ,
91+ 'product/([0-9] +)/([0-9] +) ' => '\Tests\Support\Controllers\Hello::index/$2/$1 ' ,
9392 ];
9493 $ this ->assertSame ($ expects , $ routes );
9594 }
@@ -102,7 +101,7 @@ public function testBasicAddCallableWithParamsWithoutString()
102101
103102 $ routes = $ routes ->getRoutes ();
104103 $ expects = [
105- 'product/(\d +)/(\d +) ' => '\Tests\Support\Controllers\Hello::index/$1/$2 ' ,
104+ 'product/([0-9] +)/([0-9] +) ' => '\Tests\Support\Controllers\Hello::index/$1/$2 ' ,
106105 ];
107106 $ this ->assertSame ($ expects , $ routes );
108107 }
@@ -238,7 +237,7 @@ public function testAddRecognizesCustomNamespaces()
238237 $ routes ->add ('home ' , 'controller ' );
239238
240239 $ expects = [
241- 'home ' => '\\' . controller::class ,
240+ 'home ' => '\CodeIgniter\ controller ' ,
242241 ];
243242
244243 $ routes = $ routes ->getRoutes ();
@@ -616,10 +615,10 @@ public function testResourcesWithCustomPlaceholder()
616615 $ routes ->resource ('photos ' , ['placeholder ' => ':num ' ]);
617616
618617 $ expected = [
619- 'photos ' => '\Photos::index ' ,
620- 'photos/new ' => '\Photos::new ' ,
621- 'photos/(\d +)/edit ' => '\Photos::edit/$1 ' ,
622- 'photos/(\d +) ' => '\Photos::show/$1 ' ,
618+ 'photos ' => '\Photos::index ' ,
619+ 'photos/new ' => '\Photos::new ' ,
620+ 'photos/([0-9] +)/edit ' => '\Photos::edit/$1 ' ,
621+ 'photos/([0-9] +) ' => '\Photos::show/$1 ' ,
623622 ];
624623
625624 $ this ->assertSame ($ expected , $ routes ->getRoutes ());
@@ -634,10 +633,10 @@ public function testResourcesWithDefaultPlaceholder()
634633 $ routes ->resource ('photos ' );
635634
636635 $ expected = [
637- 'photos ' => '\Photos::index ' ,
638- 'photos/new ' => '\Photos::new ' ,
639- 'photos/(\d +)/edit ' => '\Photos::edit/$1 ' ,
640- 'photos/(\d +) ' => '\Photos::show/$1 ' ,
636+ 'photos ' => '\Photos::index ' ,
637+ 'photos/new ' => '\Photos::new ' ,
638+ 'photos/([0-9] +)/edit ' => '\Photos::edit/$1 ' ,
639+ 'photos/([0-9] +) ' => '\Photos::show/$1 ' ,
641640 ];
642641
643642 $ this ->assertSame ($ expected , $ routes ->getRoutes ());
@@ -1400,7 +1399,7 @@ public function testOffsetParameters()
14001399 $ routes = $ this ->getCollector ();
14011400
14021401 $ routes ->get ('users/(:num) ' , 'users/show/$1 ' , ['offset ' => 1 ]);
1403- $ expected = ['users/(\d +) ' => '\users/show/$2 ' ];
1402+ $ expected = ['users/([0-9] +) ' => '\users/show/$2 ' ];
14041403 $ this ->assertSame ($ expected , $ routes ->getRoutes ());
14051404 }
14061405
0 commit comments