Skip to content

test: verify provider key lookup, claims contract and redirect route args#48

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

test: verify provider key lookup, claims contract and redirect route args#48
turegjorup merged 2 commits into
developfrom
test/mutation-security

Conversation

@turegjorup

Copy link
Copy Markdown
Contributor

Summary

Last of four scoped follow-ups to #44 killing surviving mutants to push the mutation score above 90%. This PR covers src/Security (4 escaped mutants).

Features Added

  • OpenIdConfigurationProviderManagerTest: the redirect-route test now mocks the router with exact argument expectations (route, redirect_route_parameters, ABSOLUTE_URL) — previously a stub ignored its arguments, so the parameters could be dropped undetected
  • OpenIdLoginAuthenticatorTest: the success path now expects getProvider() to be called with the exact provider key from the session, and asserts the returned claims contain both the IdP claims and open_id_connect_provider (the documented claims contract)
  • TestAuthenticator fixture exposes the last validated claims so tests can assert on the full array (validateClaims is protected)
  • CliLoginTokenAuthenticatorTest: new test for a request with no loginToken parameter at all — the null must be coerced and rejected as unauthorized, not passed to the login helper (only the empty-string case was covered)

Files Changed

  • tests/Security/OpenIdConfigurationProviderManagerTest.php - router argument expectations
  • tests/Security/OpenIdLoginAuthenticatorTest.php - provider key + claims contract assertions
  • tests/Security/TestAuthenticator.php - expose last claims for assertions
  • tests/Security/CliLoginTokenAuthenticatorTest.php - missing-token test
  • CHANGELOG.md - Unreleased bullet

Test Plan

  • vendor/bin/phpunit — 80 tests, 177 assertions, green
  • vendor/bin/infection --filter=src/Security — 48/48 mutants killed (was 44/48)
  • PHPStan max level + php-cs-fixer — clean

🤖 Generated with Claude Code

…args

Mutation testing exposed argument-blind stubs across the Security
tests: the router stub ignored the redirect_route_parameters when
building a provider redirect URI, the provider manager stub matched
any key (so a mangled session provider key went unnoticed), the claims
returned by validateClaims were never asserted to include the
open_id_connect_provider key, and a request with no loginToken at all
was untested (only the empty-string case was). Kills all 4 escaped
mutants in src/Security.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov-commenter

codecov-commenter 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 (52eee94) to head (51ffcdb).

Additional details and impacted files
@@             Coverage Diff             @@
##             develop       #48   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity        62        62           
===========================================
  Files              9         9           
  Lines            282       282           
===========================================
  Hits             282       282           
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 79e62dc into develop Jun 11, 2026
16 checks passed
@turegjorup turegjorup deleted the test/mutation-security branch June 11, 2026 08:37
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.

2 participants