diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-11-27 15:27:18 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-11-27 15:27:18 +0100 |
commit | 3a7cf40aaa678bea1df143d2982d603b7a334eec (patch) | |
tree | 63c1e3ad7f7f401d14411a4d44c523632906afc9 /apps/settings/tests/Middleware | |
parent | 0568b012672d650c6b5a49e72c4028dde5463c60 (diff) | |
download | nextcloud-server-3a7cf40aaa678bea1df143d2982d603b7a334eec.tar.gz nextcloud-server-3a7cf40aaa678bea1df143d2982d603b7a334eec.zip |
Mode to modern phpunit
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/settings/tests/Middleware')
-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()); |