From 683bb6e27442e08f540451e6e3e8bdbd49379d96 Mon Sep 17 00:00:00 2001 From: Anna Larch Date: Tue, 26 May 2026 23:18:55 +0200 Subject: [PATCH] test: replace checkbox assertions with DoesNotPerformAssertions (middleware) test: replace checkbox assertions with DoesNotPerformAssertions (middleware) Signed-off-by: Anna Larch AI-Assisted-By: Claude Sonnet 4.6 [skip ci] --- .../Middleware/Security/SameSiteCookieMiddlewareTest.php | 1 + .../Middleware/Security/SecurityMiddlewareTest.php | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/lib/AppFramework/Middleware/Security/SameSiteCookieMiddlewareTest.php b/tests/lib/AppFramework/Middleware/Security/SameSiteCookieMiddlewareTest.php index 7800371f68f33..3c40b06c8dba7 100644 --- a/tests/lib/AppFramework/Middleware/Security/SameSiteCookieMiddlewareTest.php +++ b/tests/lib/AppFramework/Middleware/Security/SameSiteCookieMiddlewareTest.php @@ -34,6 +34,7 @@ protected function setUp(): void { $this->middleware = new SameSiteCookieMiddleware($this->request, $this->reflector); } + #[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions] public function testBeforeControllerNoIndex(): void { $this->request->method('getScriptName') ->willReturn('/ocs/v2.php'); diff --git a/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php b/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php index b7d5f17cf057f..2726e1184d407 100644 --- a/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php +++ b/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php @@ -479,21 +479,21 @@ public function testIsNotSubAdminCheck(string $method): void { } #[\PHPUnit\Framework\Attributes\DataProvider('dataNoCSRFRequiredSubAdminRequired')] + #[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions] public function testIsSubAdminCheck(string $method): void { $this->reader->reflect($this->controller, $method); $sec = $this->getMiddleware(true, false, true); $sec->beforeController($this->controller, $method); - $this->addToAssertionCount(1); } #[\PHPUnit\Framework\Attributes\DataProvider('dataNoCSRFRequiredSubAdminRequired')] + #[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions] public function testIsSubAdminAndAdminCheck(string $method): void { $this->reader->reflect($this->controller, $method); $sec = $this->getMiddleware(true, true, true); $sec->beforeController($this->controller, $method); - $this->addToAssertionCount(1); } #[\PHPUnit\Framework\Attributes\DataProvider('dataNoCSRFRequired')] @@ -515,7 +515,6 @@ public function testRestrictedAppLoggedInPublicPage(string $method): void { ->willReturn(false); $middleware->beforeController($this->controller, $method); - $this->addToAssertionCount(1); } #[\PHPUnit\Framework\Attributes\DataProvider('dataNoAdminRequiredNoCSRFRequiredPublicPage')] @@ -532,7 +531,6 @@ public function testRestrictedAppNotLoggedInPublicPage(string $method): void { ->willReturn(false); $middleware->beforeController($this->controller, $method); - $this->addToAssertionCount(1); } #[\PHPUnit\Framework\Attributes\DataProvider('dataNoAdminRequiredNoCSRFRequired')]