Skip to content

test: assert container extension is created and memoized#46

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

test: assert container extension is created and memoized#46
turegjorup merged 2 commits into
developfrom
test/mutation-bundle-extension

Conversation

@turegjorup

Copy link
Copy Markdown
Contributor

Summary

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

Features Added

  • testGetContainerExtension: asserts getContainerExtension() returns an ItkDevOpenIdConnectExtension and that a second call returns the same instance. The memoization condition (null === $this->extension || false === $this->extension) previously had zero assertions against it, so all five of its mutants (operator flips, negations, ||&&) survived.

Files Changed

  • tests/ItkDevOpenIdConnectBundleTest.php - new memoization test
  • CHANGELOG.md - Unreleased bullet

Test Plan

  • vendor/bin/phpunit — 80 tests, 169 assertions, green
  • vendor/bin/infection --filter=src/ItkDevOpenIdConnectBundle.php — 5/5 mutants killed (was 0/5)
  • PHPStan max level + php-cs-fixer — clean

🤖 Generated with Claude Code

Mutation testing showed all five mutants of the getContainerExtension()
condition survived: the extension type was never asserted and repeated
calls recreating the extension went unnoticed. One test asserting the
concrete type and instance identity on a second call kills all five.

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 (643aa7b) to head (abbf969).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##             develop       #46   +/-   ##
===========================================
  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 self-assigned this Jun 11, 2026
@turegjorup turegjorup merged commit a2fd951 into develop Jun 11, 2026
16 checks passed
@turegjorup turegjorup deleted the test/mutation-bundle-extension branch June 11, 2026 08:20
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