aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/appframework/routing
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-11-19 12:00:41 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2014-11-19 12:01:42 +0100
commit4e90c44301cdacc85f31259bff887b035a1b9716 (patch)
tree5abe28a9242dbc4b5461d1ec1e2cffa2316c8fd3 /tests/lib/appframework/routing
parent91f7c0af6e627532efa2161e9ca7838d28dc42a9 (diff)
downloadnextcloud-server-4e90c44301cdacc85f31259bff887b035a1b9716.tar.gz
nextcloud-server-4e90c44301cdacc85f31259bff887b035a1b9716.zip
add postfix
add postfix
Diffstat (limited to 'tests/lib/appframework/routing')
-rw-r--r--tests/lib/appframework/routing/RoutingTest.php15
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);