test: assert full exception messages, codes and previous-chains#50
Merged
Conversation
Mutation testing showed the exception contract was only half-verified: expectExceptionMessage() matched static prefixes, so every dynamic message part (offending URL, audience list, issuer, nonce, input) could be dropped or reordered undetected, and the 0 code passed at each wrap boundary was never asserted. Wrap-boundary tests now check the full message, code 0 and the chained previous cause, and a new test covers invalid JSON from the token endpoint. Kills 33 of 57 escaped mutants (71% -> 87% covered MSI). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jun 11, 2026
…ption-assertions # Conflicts: # CHANGELOG.md
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #50 +/- ##
===========================================
Coverage 100.00% 100.00%
Complexity 71 71
===========================================
Files 1 1
Lines 185 185
===========================================
Hits 185 185
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
First of three scoped follow-ups to #49 killing surviving mutants to push the mutation score above 90%. Targets the largest cluster: exception-contract assertions (33 of 57 escaped mutants).
Features Added
validateIdToken) assert the complete message including the dynamic part — audience list, issuer, nonce — so the concatenation can't be dropped or reordered undetectedValidationException,CodeException,HttpException,JsonException,CacheException,IdentityProviderException) assert code0and the chained$previouscauseBadUrlException,IllegalSchemeException);DecodeExceptionasserts the input;HttpExceptionasserts the resource URLtestGetIdTokenRejectsInvalidJsonResponse: invalid JSON from the token endpoint wraps\JsonExceptionintoCodeException(kills aCatch_mutant on the union catch)Files Changed
tests/Security/OpenIdConfigurationProviderTest.php- assertion strengthening + one new testCHANGELOG.md- Unreleased bulletTest Plan
vendor/bin/phpunit— 98 tests, 168 assertions, greenvendor/bin/infection— 24 escaped mutants remaining, down from 57 (Covered Code MSI 71% → 87%)🤖 Generated with Claude Code