mirror of
https://github.com/dannyvankooten/AltoRouter.git
synced 2025-02-06 05:28:29 +01:00
add test for getRoutes
remove obsolete getRoutes method from debug class
This commit is contained in:
parent
60cf81c963
commit
3a932e7588
@ -7,11 +7,7 @@ class AltoRouterDebug extends AltoRouter{
|
||||
public function getNamedRoutes(){
|
||||
return $this->namedRoutes;
|
||||
}
|
||||
|
||||
public function getRoutes(){
|
||||
return $this->routes;
|
||||
}
|
||||
|
||||
|
||||
public function getBasePath(){
|
||||
return $this->basePath;
|
||||
}
|
||||
@ -72,6 +68,20 @@ class AltoRouterTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers AltoRouter::getRoutes
|
||||
*/
|
||||
public function testGetRoutes()
|
||||
{
|
||||
$method = 'POST';
|
||||
$route = '/[:controller]/[:action]';
|
||||
$target = function(){};
|
||||
|
||||
$this->assertInternalType('array', $this->router->getRoutes());
|
||||
$this->router->map($method, $route, $target);
|
||||
$this->assertEquals(array(array($method, $route, $target, null)), $this->router->getRoutes());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers AltoRouter::addRoutes
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user