mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
dont strip the s from the resource
This commit is contained in:
parent
1822bba5e9
commit
5496ca234b
2 changed files with 6 additions and 6 deletions
|
|
@ -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}';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue