Skip to content
Snippets Groups Projects
Commit 5496ca23 authored by Bernhard Posselt's avatar Bernhard Posselt
Browse files

dont strip the s from the resource

parent 1822bba5
No related branches found
No related tags found
No related merge requests found
......@@ -174,7 +174,7 @@ class RouteConfig {
* @return string
*/
private function buildResourceId($resource) {
return '{'.$this->underScoreToCamelCase(rtrim($resource, 's')).'Id}';
return '{' . $this->underScoreToCamelCase($resource) . 'Id}';
}
/**
......
......@@ -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');
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment