aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/tests/Middleware
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-06-07 10:05:18 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2022-06-07 10:05:18 +0200
commitc0c54b20d95fac9ca4672403157c16ca232e36a8 (patch)
treeca012a6d2ff5c826ea8e49977c0fd69d7a94791a /apps/settings/tests/Middleware
parent407ba4a8bfc264cc4dcffe3196d901415853c7e5 (diff)
downloadnextcloud-server-c0c54b20d95fac9ca4672403157c16ca232e36a8.tar.gz
nextcloud-server-c0c54b20d95fac9ca4672403157c16ca232e36a8.zip
Remove deprecated at() matcher from settings tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/settings/tests/Middleware')
-rw-r--r--apps/settings/tests/Middleware/SubadminMiddlewareTest.php26
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');
}