8000 Test `AuthenticatorManager`s are injected traceable authenticators in… · symfony/symfony@c9c19ab · GitHub
[go: up one dir, main page]

Skip to content

Commit c9c19ab

Browse files
committed
Test AuthenticatorManagers are injected traceable authenticators in debug mode
1 parent ffbd82c commit c9c19ab

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ public function testCustomHasherWithMigrateFrom()
902902
]);
903903
}
904904

905-
public function testAuthenticatorsStillExistAfterBeingDecorated()
905+
public function testAuthenticatorsDecoration()
906906
{
907907
$container = $this->getRawContainer();
908908
$container->setParameter('kernel.debug', true);
@@ -918,7 +918,12 @@ public function testAuthenticatorsStillExistAfterBeingDecorated()
918918
]);
919919
$container->compile();
920920

921-
$this->assertTrue($container->hasDefinition(TestAuthenticator::class));
921+
/** @var Reference[] $managerAuthenticators */
922+
$managerAuthenticators = $container->getDefinition('security.authenticator.manager.main')->getArgument(0);
923+
$this->assertCount(1, $managerAuthenticators);
924+
$this->assertSame('debug.'.TestAuthenticator::class, (string) reset($managerAuthenticators), 'AuthenticatorManagers must be injected traceable authenticators in debug mode.');
925+
926+
$this->assertTrue($container->hasDefinition(TestAuthenticator::class), 'Original authenticator must still exist in the container so it can be used outside of the AuthenticatorManager’s context.');
922927
}
923928

924929
protected function getRawContainer()

0 commit comments

Comments
 (0)
0