mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
Added new Router test.
This commit is contained in:
parent
abee717a2c
commit
f44b7f6515
@ -31,6 +31,7 @@ class RouterTest extends \CIUnitTestCase
|
||||
'{locale}/pages' => 'App\Pages::list_all',
|
||||
'Admin/Admins' => 'App\Admin\Admins::list_all',
|
||||
'/some/slash' => 'App\Slash::index',
|
||||
'objects/(:segment)/sort/(:segment)/([A-Z]{3,7})' => 'AdminList::objectsSortCreate/$1/$2/$3'
|
||||
];
|
||||
|
||||
$this->collection->map($routes);
|
||||
@ -128,6 +129,21 @@ class RouterTest extends \CIUnitTestCase
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @see https://github.com/bcit-ci/CodeIgniter4/issues/672
|
||||
*/
|
||||
public function testURIMapsParamsWithMany()
|
||||
{
|
||||
$router = new Router($this->collection);
|
||||
|
||||
$router->handle('objects/123/sort/abc/FOO');
|
||||
|
||||
$this->assertEquals('objectsSortCreate', $router->methodName());
|
||||
$this->assertEquals([123, 'abc', 'FOO'], $router->params());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
public function testClosures()
|
||||
{
|
||||
$router = new Router($this->collection);
|
||||
|
Loading…
x
Reference in New Issue
Block a user