Skip to content

test: assert DI extension wiring and provider key normalization invariant#45

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

test: assert DI extension wiring and provider key normalization invariant#45
turegjorup merged 2 commits into
developfrom
test/mutation-dependency-injection

Conversation

@turegjorup

Copy link
Copy Markdown
Contributor

Summary

First of four scoped follow-ups to #44 killing surviving mutants to push the mutation score above 90%. This PR covers src/DependencyInjection (8 escaped mutants — the largest single cluster).

Features Added

  • ItkDevOpenIdConnectExtensionTest: two new tests asserting the container wiring the extension performs — the cacheItemPool Reference on the provider manager config, the provider options mapping (keyed by provider name, options level stripped), and the $cache/$cliLoginRoute arguments on CliLoginHelper, UserLoginCommand and CliLoginTokenAuthenticator. Previously only hasDefinition() was checked, so every replaceArgument() call could be deleted without a failing test.
  • ConfigurationTest: test for the documented invariant that provider keys are not normalized (my-provider and my_provider are distinct providers) — normalizeKeys(false) could be flipped to true undetected.

Files Changed

  • tests/DependencyInjection/ItkDevOpenIdConnectExtensionTest.php - wiring assertions
  • tests/DependencyInjection/ConfigurationTest.php - key normalization test
  • CHANGELOG.md - Unreleased bullet

Test Plan

  • vendor/bin/phpunit — 82 tests, 182 assertions, green
  • vendor/bin/infection --filter=src/DependencyInjection — 20/20 mutants killed (was 12/20)
  • PHPStan max level + php-cs-fixer — clean

🤖 Generated with Claude Code

…iant

Mutation testing showed the extension's container wiring was executed
but never verified: every replaceArgument() call could be removed, the
cacheItemPool reference dropped, and the provider options array_map
unwrapped without a failing test. The documented invariant that
provider keys are not normalized (my-provider != my_provider) was also
untested. Kills all 20 mutants in src/DependencyInjection (was 12/20).

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 (25afc4c) to head (a03ca2d).

Additional details and impacted files
@@             Coverage Diff             @@
##             develop       #45   +/-   ##
===========================================
  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 643aa7b into develop Jun 11, 2026
16 checks passed
@turegjorup turegjorup deleted the test/mutation-dependency-injection branch June 11, 2026 08:15
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