Skip to content

Restore pipeline: CacheHeadersEventListener unit tests + CS fixes - #202

Merged
silverbackdan merged 1 commit into
mainfrom
chore/pipeline-mutation-cs
Jul 17, 2026
Merged

Restore pipeline: CacheHeadersEventListener unit tests + CS fixes#202
silverbackdan merged 1 commit into
mainfrom
chore/pipeline-mutation-cs

Conversation

@silverbackdan

Copy link
Copy Markdown
Collaborator

Summary

Restores the pipeline after #200 / #201.

  • Mutation score 84.45% → 85.3% (≥ 85% minimum). Infection runs PHPUnit, not Behat, so features/main/cache_headers.feature did not register coverage for the new CacheHeadersEventListener. Added tests/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 (real PublishableAttributeReader via 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.
  • CS fixes applied for the pipeline in UploadableAttributeReader and ManifestDepthGroupTrait (+ its test).

No production behaviour changed. Full PHPUnit suite green (543 tests).

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

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 27.07%. Comparing base (c629748) to head (51d6352).

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     
Flag Coverage Δ
phpunit 27.07% <100.00%> (+0.94%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@silverbackdan
silverbackdan merged commit 4dd933a into main Jul 17, 2026
10 of 13 checks passed
@silverbackdan
silverbackdan deleted the chore/pipeline-mutation-cs branch July 17, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant