diff options
Diffstat (limited to 'apps/settings/tests/Middleware/SubadminMiddlewareTest.php')
-rw-r--r-- | apps/settings/tests/Middleware/SubadminMiddlewareTest.php | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/apps/settings/tests/Middleware/SubadminMiddlewareTest.php b/apps/settings/tests/Middleware/SubadminMiddlewareTest.php index a6317173439..a1330857e02 100644 --- a/apps/settings/tests/Middleware/SubadminMiddlewareTest.php +++ b/apps/settings/tests/Middleware/SubadminMiddlewareTest.php @@ -68,15 +68,12 @@ class SubadminMiddlewareTest extends \Test\TestCase { $this->expectException(\OC\AppFramework\Middleware\Security\Exceptions\NotAdminException::class); $this->reflector - ->expects($this->at(0)) + ->expects($this->exactly(2)) ->method('hasAnnotation') - ->with('NoSubAdminRequired') - ->willReturn(false); - $this->reflector - ->expects($this->at(1)) - ->method('hasAnnotation') - ->with('AuthorizedAdminSetting') - ->willReturn(false); + ->withConsecutive( + ['NoSubAdminRequired'], + ['AuthorizedAdminSetting'], + )->willReturn(false); $this->subadminMiddleware->beforeController($this->controller, 'foo'); } @@ -92,15 +89,12 @@ class SubadminMiddlewareTest extends \Test\TestCase { public function testBeforeControllerAsSubAdminWithoutExemption() { $this->reflector - ->expects($this->at(0)) - ->method('hasAnnotation') - ->with('NoSubAdminRequired') - ->willReturn(false); - $this->reflector - ->expects($this->at(1)) + ->expects($this->exactly(2)) ->method('hasAnnotation') - ->with('AuthorizedAdminSetting') - ->willReturn(false); + ->withConsecutive( + ['NoSubAdminRequired'], + ['AuthorizedAdminSetting'], + )->willReturn(false); $this->subadminMiddlewareAsSubAdmin->beforeController($this->controller, 'foo'); } |