diff options
Diffstat (limited to 'apps/settings/tests/Middleware/SubadminMiddlewareTest.php')
-rw-r--r-- | apps/settings/tests/Middleware/SubadminMiddlewareTest.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/settings/tests/Middleware/SubadminMiddlewareTest.php b/apps/settings/tests/Middleware/SubadminMiddlewareTest.php index e2434c01b02..51914604a98 100644 --- a/apps/settings/tests/Middleware/SubadminMiddlewareTest.php +++ b/apps/settings/tests/Middleware/SubadminMiddlewareTest.php @@ -47,10 +47,10 @@ class SubadminMiddlewareTest extends \Test\TestCase { $this->subadminMiddleware = new SubadminMiddleware($this->reflector, false, $this->l10n); } - /** - * @expectedException \OC\AppFramework\Middleware\Security\Exceptions\NotAdminException - */ + public function testBeforeControllerAsUserWithExemption() { + $this->expectException(\OC\AppFramework\Middleware\Security\Exceptions\NotAdminException::class); + $this->reflector ->expects($this->once()) ->method('hasAnnotation') @@ -93,10 +93,10 @@ class SubadminMiddlewareTest extends \Test\TestCase { $this->assertEquals($expectedResponse, $this->subadminMiddleware->afterException($this->controller, 'foo', new NotAdminException(''))); } - /** - * @expectedException \Exception - */ + public function testAfterRegularException() { + $this->expectException(\Exception::class); + $expectedResponse = new TemplateResponse('core', '403', array(), 'guest'); $expectedResponse->setStatus(403); $this->subadminMiddleware->afterException($this->controller, 'foo', new \Exception()); |