Repository navigation
test: raise unit coverage to 99 %, two permission fixes - #25
Merged
Merged
Conversation
added 2 commits
November 27, 2026 17:09
…ith public pages only
Preview, manifest, search, doctor, SEO sources, service provider, media permissions, constants (each in its own process). A GraphQL test no longer leaves an Authorization header behind for the next test.
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.
Raises the line coverage of
src/by the unit suite from 85.3 % (2146/2516) onmainto 99.7 % (2585/2592), measured with pcov on PHP 8.4. #24 alone takes it to 93.2 %.Stacked on #24: retarget to
mainbefore thechore/phpstan-maxbranch is deleted.The tests assert effects (answers, headers, queries, which user the code runs as and whether it is given back), with attention to the failure paths: preview sessions and their refusals, who may see a file, REST answers that fail, filters and blocks that throw.
Two fixes (first commit)
Both stay within the HTTP contract. Each has a test that fails without the fix.
Test support
tests/Stubs/wordpress.phpdeclares the few WordPress classes the code builds withnew(and a Contact Form 7 stand-in).exitdecides runs in a PHP process of its own (tests/Fixtures/isolated.php). These checks are real, but pcov does not count them: they are the 7 lines left.Authorizationheader behind, which made another test fail in random order.Notes
register.phpalready had@codeCoverageIgnorearound the WP-CLI registration, so it is not measured..harness.jsonrecords no coverage floor: recording one is left to a maintainer.