Skip to content

test: pin request factory wiring and zero-boundary option values#52

Merged
turegjorup merged 2 commits into
developfrom
test/mutation-constructor-boundaries
Jun 11, 2026
Merged

test: pin request factory wiring and zero-boundary option values#52
turegjorup merged 2 commits into
developfrom
test/mutation-constructor-boundaries

Conversation

@turegjorup

Copy link
Copy Markdown
Collaborator

Summary

Third of three scoped follow-ups to #49. Targets constructor wiring and option boundaries (3 escaped mutants).

Features Added

  • testConstructWiresJwtCollaboratorAsRequestFactory: the jwt collaborator must become the provider's request factory — removing the wiring silently substituted the parent's default factory
  • testConstructZeroCacheDurationAndLeewayAccepted: 0 is a valid boundary for both options (cache nothing / tolerate no clock skew); the < 0 guards could mutate to <= 0 undetected — the textbook boundary mutant

Files Changed

  • tests/Security/OpenIdConfigurationProviderTest.php - two new tests
  • CHANGELOG.md - Unreleased bullet

Test Plan

  • vendor/bin/phpunit — 99 tests, 162 assertions, green
  • vendor/bin/infection — kills its 3 targeted mutants (57 → 54 on this branch alone)
  • PHPStan max level + php-cs-fixer — clean

Notes

Combined with #50 and #51 this leaves 13 escaped mutants, all equivalent or contrived (JSON depth-512 literals, random-string default lengths, casts only observable on corrupted cache, an unreachable catch-union member). A final PR will ratchet minCoveredMsi accordingly.

🤖 Generated with Claude Code

Mutation testing showed the constructor's setRequestFactory call could
be removed (silently falling back to the parent's default factory) and
the < 0 guards on cacheDuration/leeway could become <= 0 (rejecting
the valid boundary value 0) without a failing test. Kills 3 escaped
mutants.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@turegjorup turegjorup self-assigned this Jun 11, 2026
…tructor-boundaries

# Conflicts:
#	CHANGELOG.md
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (6438d0a) to head (8ac6b79).

Additional details and impacted files
@@             Coverage Diff             @@
##             develop       #52   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity        71        71           
===========================================
  Files              1         1           
  Lines            185       185           
===========================================
  Hits             185       185           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

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.

@turegjorup turegjorup merged commit d3b8c2b into develop Jun 11, 2026
17 checks passed
@turegjorup turegjorup deleted the test/mutation-constructor-boundaries branch June 11, 2026 09:18
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