diff --git a/CHANGELOG.md b/CHANGELOG.md index f7e4137..b114a52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Dev: added a test for `ItkDevOpenIdConnectBundle::getContainerExtension()` + asserting the custom extension is created and memoized (same instance on + repeated calls), prompted by mutation testing findings. No effect on the + published package. - Dev: strengthened DependencyInjection tests based on mutation testing findings — the extension's container wiring (cache pool reference, provider options mapping, CLI login route arguments) is now asserted diff --git a/tests/ItkDevOpenIdConnectBundleTest.php b/tests/ItkDevOpenIdConnectBundleTest.php index 6948230..1593cd3 100644 --- a/tests/ItkDevOpenIdConnectBundleTest.php +++ b/tests/ItkDevOpenIdConnectBundleTest.php @@ -4,6 +4,8 @@ use ItkDev\OpenIdConnectBundle\Command\UserLoginCommand; use ItkDev\OpenIdConnectBundle\Controller\LoginController; +use ItkDev\OpenIdConnectBundle\DependencyInjection\ItkDevOpenIdConnectExtension; +use ItkDev\OpenIdConnectBundle\ItkDevOpenIdConnectBundle; use ItkDev\OpenIdConnectBundle\Security\CliLoginTokenAuthenticator; use ItkDev\OpenIdConnectBundle\Security\OpenIdConfigurationProviderManager; use ItkDev\OpenIdConnectBundle\Security\OpenIdLoginAuthenticator; @@ -57,4 +59,18 @@ public function testServiceWiring(): void $authenticator = $container->get(CliLoginTokenAuthenticator::class); $this->assertInstanceOf(CliLoginTokenAuthenticator::class, $authenticator); } + + /** + * Test that the custom container extension is created and memoized. + */ + public function testGetContainerExtension(): void + { + $bundle = new ItkDevOpenIdConnectBundle(); + + $extension = $bundle->getContainerExtension(); + $this->assertInstanceOf(ItkDevOpenIdConnectExtension::class, $extension); + + // Repeated calls must return the same instance, not recreate it. + $this->assertSame($extension, $bundle->getContainerExtension()); + } }