Skip to content

Navigation Menu

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 c9c19ab

Browse filesBrowse files
committed
Test AuthenticatorManagers are injected traceable authenticators in debug mode
1 parent ffbd82c commit c9c19ab
Copy full SHA for c9c19ab

File tree

1 file changed

+7
-2
lines changed
Filter options

1 file changed

+7
-2
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php
+7-2Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.