diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-02-26 15:32:17 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2018-02-26 17:00:29 +0100 |
commit | cf35c4b03ab7bd73cc5e9a26d88a0c61731d4b6e (patch) | |
tree | 86862b1127934c6c6261b9cd248eaafcf355bf4c /tests/Settings | |
parent | 98baf8915dcaba69266820066cb49abbcc43e624 (diff) | |
download | nextcloud-server-cf35c4b03ab7bd73cc5e9a26d88a0c61731d4b6e.tar.gz nextcloud-server-cf35c4b03ab7bd73cc5e9a26d88a0c61731d4b6e.zip |
Provide translated error message for permission error
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'tests/Settings')
-rw-r--r-- | tests/Settings/Middleware/SubadminMiddlewareTest.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/Settings/Middleware/SubadminMiddlewareTest.php b/tests/Settings/Middleware/SubadminMiddlewareTest.php index 834a3fedf23..b464b595ab7 100644 --- a/tests/Settings/Middleware/SubadminMiddlewareTest.php +++ b/tests/Settings/Middleware/SubadminMiddlewareTest.php @@ -15,6 +15,7 @@ use OC\AppFramework\Utility\ControllerMethodReflector; use OC\Settings\Middleware\SubadminMiddleware; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\TemplateResponse; +use OCP\IL10N; /** * Verifies whether an user has at least subadmin rights. @@ -31,6 +32,8 @@ class SubadminMiddlewareTest extends \Test\TestCase { private $reflector; /** @var Controller */ private $controller; + /** @var IL10N */ + private $l10n; protected function setUp() { parent::setUp(); @@ -38,9 +41,10 @@ class SubadminMiddlewareTest extends \Test\TestCase { ->disableOriginalConstructor()->getMock(); $this->controller = $this->getMockBuilder(Controller::class) ->disableOriginalConstructor()->getMock(); + $this->l10n = $this->createMock(IL10N::class); - $this->subadminMiddlewareAsSubAdmin = new SubadminMiddleware($this->reflector, true); - $this->subadminMiddleware = new SubadminMiddleware($this->reflector, false); + $this->subadminMiddlewareAsSubAdmin = new SubadminMiddleware($this->reflector, true, $this->l10n); + $this->subadminMiddleware = new SubadminMiddleware($this->reflector, false, $this->l10n); } /** @@ -86,7 +90,7 @@ class SubadminMiddlewareTest extends \Test\TestCase { public function testAfterNotAdminException() { $expectedResponse = new TemplateResponse('core', '403', array(), 'guest'); $expectedResponse->setStatus(403); - $this->assertEquals($expectedResponse, $this->subadminMiddleware->afterException($this->controller, 'foo', new NotAdminException())); + $this->assertEquals($expectedResponse, $this->subadminMiddleware->afterException($this->controller, 'foo', new NotAdminException(''))); } /** |