1
0
mirror of https://github.com/dannyvankooten/AltoRouter.git synced 2025-08-06 16:36:43 +02:00

Add addRoutes method for bulk adding routes

This commit is contained in:
Koen Punt
2014-04-16 11:17:42 +02:00
parent fb41766c3d
commit dbe416b9b9
3 changed files with 38 additions and 4 deletions

View File

@@ -45,6 +45,26 @@ class AltoRouterTest extends PHPUnit_Framework_TestCase
{
}
/**
* @covers AltoRouter::addRoutes
*/
public function testAddRoutes()
{
$method = 'POST';
$route = '/[:controller]/[:action]';
$target = function(){};
$this->router->addRoutes(array(
array($method, $route, $target),
array($method, $route, $target, 'second_route')
));
$routes = $this->router->getRoutes();
$this->assertEquals(array($method, $route, $target, null), $routes[0]);
$this->assertEquals(array($method, $route, $target, 'second_route'), $routes[1]);
}
/**
* @covers AltoRouter::setBasePath
*/