test: replace checkbox assertions with DoesNotPerformAssertions (misc)#60747
Draft
miaulalala wants to merge 1 commit into
Draft
test: replace checkbox assertions with DoesNotPerformAssertions (misc)#60747miaulalala wants to merge 1 commit into
miaulalala wants to merge 1 commit into
Conversation
2 tasks
miaulalala
added a commit
that referenced
this pull request
May 26, 2026
… (middleware) Replace `addToAssertionCount(1)` placeholders in AppFramework middleware tests that only verify no exception is thrown. For `SameSiteCookieMiddlewareTest`, two tests already have `expects(self::once())` mock expectations as their real assertion — those just have the redundant placeholder removed. The third test has no expectations and gets `#[DoesNotPerformAssertions]`. For `SecurityMiddlewareTest`, `testIsSubAdminCheck` and `testIsSubAdminAndAdminCheck` get `#[DoesNotPerformAssertions]`. `testRestrictedAppLoggedInPublicPage` and `testRestrictedAppNotLoggedInPublicPage` have `->with()` argument constraints that count as assertions in PHPUnit 11, so the redundant placeholder is simply removed. Part of a broader effort to eliminate checkbox tests (see also #60742, #60747). Signed-off-by: Anna Larch <anna@nextcloud.com> AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Anna Larch <anna@nextcloud.com> AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1bec2b5 to
87230b3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces
addToAssertionCount(1)andassertFalse(false)placeholder assertions with#[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions]across 15 unrelated test files.addToAssertionCount(1)solely to suppress the PHPUnit "risky test" warning — they verify only that no exception is thrownEncryptionTestuseassertFalse(false)as a placeholder, but both already have realexpects($this->once())mock expectations that serve as the meaningful assertion"Doesn't assert anything"docblock comments inCrashReport/RegistryTestandSubscription/RegistryTestare removed since#[DoesNotPerformAssertions]communicates the same intentPart of a broader effort to eliminate checkbox tests across the test suite (see also #60742).
Test plan
🤖 Generated with Claude Code