[Pkg-owncloud-commits] [owncloud] 23/121: dont strip the s from the resource

David Prévot taffit at moszumanska.debian.org
Thu Aug 21 16:44:27 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 8417f55b0196b48ca9ab0d681c291576c8796c8f
Author: Bernhard Posselt <dev at bernhard-posselt.com>
Date:   Thu Jun 26 14:02:20 2014 +0200

    dont strip the s from the resource
---
 lib/private/appframework/routing/routeconfig.php | 4 ++--
 tests/lib/appframework/routing/RoutingTest.php   | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/private/appframework/routing/routeconfig.php b/lib/private/appframework/routing/routeconfig.php
index 91ea777..634bc88 100644
--- a/lib/private/appframework/routing/routeconfig.php
+++ b/lib/private/appframework/routing/routeconfig.php
@@ -88,7 +88,7 @@ class RouteConfig {
 							->method($verb)
 							->action($handler);
 
-			// optionally register requirements for route. This is used to 
+			// optionally register requirements for route. This is used to
 			// tell the route parser how url parameters should be matched
 			if(array_key_exists('requirements', $simpleRoute)) {
 				$router->requirements($simpleRoute['requirements']);
@@ -174,7 +174,7 @@ class RouteConfig {
 	 * @return string
 	 */
 	private function buildResourceId($resource) {
-		return '{'.$this->underScoreToCamelCase(rtrim($resource, 's')).'Id}';
+		return '{' . $this->underScoreToCamelCase($resource) . 'Id}';
 	}
 
 	/**
diff --git a/tests/lib/appframework/routing/RoutingTest.php b/tests/lib/appframework/routing/RoutingTest.php
index 261ab0b..89cc77d 100644
--- a/tests/lib/appframework/routing/RoutingTest.php
+++ b/tests/lib/appframework/routing/RoutingTest.php
@@ -6,7 +6,7 @@ use OC\AppFramework\DependencyInjection\DIContainer;
 use OC\AppFramework\routing\RouteConfig;
 
 
-class RouteConfigTest extends \PHPUnit_Framework_TestCase
+class RoutingTest extends \PHPUnit_Framework_TestCase
 {
 
 	public function testSimpleRoute()
@@ -76,16 +76,16 @@ class RouteConfigTest extends \PHPUnit_Framework_TestCase
 
 	public function testResource()
 	{
-		$routes = array('resources' => array('accounts' => array('url' => '/accounts')));
+		$routes = array('resources' => array('account' => array('url' => '/accounts')));
 
-		$this->assertResource($routes, 'accounts', '/accounts', 'AccountsController', 'accountId');
+		$this->assertResource($routes, 'account', '/accounts', 'AccountController', 'accountId');
 	}
 
 	public function testResourceWithUnderScoreName()
 	{
 		$routes = array('resources' => array('admin_accounts' => array('url' => '/admin/accounts')));
 
-		$this->assertResource($routes, 'admin_accounts', '/admin/accounts', 'AdminAccountsController', 'adminAccountId');
+		$this->assertResource($routes, 'admin_accounts', '/admin/accounts', 'AdminAccountsController', 'adminAccountsId');
 	}
 
 	/**

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list