Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions tests/ItkDevOpenIdConnectBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
}
}
Loading