mirror of
https://github.com/dannyvankooten/AltoRouter.git
synced 2025-03-13 22:09:39 +01:00
Merge pull request #105 from koenpunt/add-getroutes
add test for getRoutes
This commit is contained in:
commit
179d2fe5bc
@ -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