diff options
Diffstat (limited to 'tests/lib/appframework/routing/RoutingTest.php')
-rw-r--r-- | tests/lib/appframework/routing/RoutingTest.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/lib/appframework/routing/RoutingTest.php b/tests/lib/appframework/routing/RoutingTest.php index a1d9a51a3c8..503bad837c2 100644 --- a/tests/lib/appframework/routing/RoutingTest.php +++ b/tests/lib/appframework/routing/RoutingTest.php @@ -54,6 +54,15 @@ class RoutingTest extends \PHPUnit_Framework_TestCase $this->assertSimpleRoute($routes, 'folders.open', 'DELETE', '/folders/{folderId}/open', 'FoldersController', 'open', array(), array('param' => 'foobar')); } + public function testSimpleRouteWithPostfix() + { + $routes = array('routes' => array( + array('name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete', 'postfix' => '_something') + )); + + $this->assertSimpleRoute($routes, 'folders.open', 'DELETE', '/folders/{folderId}/open', 'FoldersController', 'open', array(), array(), '_something'); + } + /** * @expectedException \UnexpectedValueException @@ -104,8 +113,12 @@ class RoutingTest extends \PHPUnit_Framework_TestCase * @param string $controllerName * @param string $actionName */ - private function assertSimpleRoute($routes, $name, $verb, $url, $controllerName, $actionName, array $requirements=array(), array $defaults=array()) + private function assertSimpleRoute($routes, $name, $verb, $url, $controllerName, $actionName, array $requirements=array(), array $defaults=array(), $postfix='') { + if ($postfix) { + $name .= $postfix; + } + // route mocks $route = $this->mockRoute($verb, $controllerName, $actionName, $requirements, $defaults); |