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

Skip to content
Sign in

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 111913e

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

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), 'AuthenticatorManager 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