mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
[FEATURE] Changed behavior for default-namespace after issue #446
- Router::setDefaultNamespace() no longer has to be set in the beginning of routes.php. - Default namespace are now set once the router is started (Router::start()). - [WIP] Added unit-tests for custom-namespaces.
This commit is contained in:
@@ -183,4 +183,26 @@ class RouterUrlTest extends \PHPUnit\Framework\TestCase
|
||||
$this->assertEquals('match', $output);
|
||||
}
|
||||
|
||||
public function testDefaultNamespace()
|
||||
{
|
||||
TestRouter::setDefaultNamespace('\\TestRoutersss');
|
||||
|
||||
TestRouter::get('/', 'DummyController@method1', ['as' => 'home']);
|
||||
TestRouter::get('/about', 'DummyController@about');
|
||||
|
||||
TestRouter::group([
|
||||
'prefix' => '/horses',
|
||||
], function() {
|
||||
|
||||
TestRouter::get('/about', 'DummyController@about');
|
||||
|
||||
});
|
||||
|
||||
|
||||
TestRouter::debugNoReset('/horses/about');
|
||||
|
||||
|
||||
$routes = TestRouter::router()->getRoutes();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user