Restore pipeline: CacheHeadersEventListener unit tests + CS fixes - #202
Merged
Conversation
Add tests/EventListener/Api/CacheHeadersEventListenerTest.php (9 tests) to kill the mutants left by the #200 listener - Infection runs PHPUnit, not Behat, so the cache_headers.feature coverage did not register. Every branch is covered (method/resource-class guards, configured-class and subclass matches, publishable fallback, and the authenticated-token check), taking mutation score 84.45% -> 85.3%, back above the 85% pipeline minimum. No production behaviour changed. Also includes coding-standards fixes applied for the pipeline in UploadableAttributeReader and ManifestDepthGroupTrait (+ its test).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #202 +/- ##
============================================
+ Coverage 26.13% 27.07% +0.94%
Complexity 2526 2526
============================================
Files 253 253
Lines 7370 7364 -6
============================================
+ Hits 1926 1994 +68
+ Misses 5444 5370 -74
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
Restores the pipeline after #200 / #201.
features/main/cache_headers.featuredid not register coverage for the newCacheHeadersEventListener. Addedtests/EventListener/Api/CacheHeadersEventListenerTest.php(9 tests, 25 assertions) covering every branch — method/resource-class guards, configured-class + subclass (is_a(..., true)) matches, the publishable fallback (realPublishableAttributeReadervia reflection, not stubbed behaviour), and the authenticated-token check. Zero mutants escape in the Emit cache-safety headers (Vary + Cache-Control) so responses varying by cookie/path can be safely cached #200 code.UploadableAttributeReaderandManifestDepthGroupTrait(+ its test).No production behaviour changed. Full PHPUnit suite green (543 tests).