|
20 | 20 | use Symfony\Component\Config\Definition\Builder\NodeDefinition;
|
21 | 21 | use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
|
22 | 22 | use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
|
| 23 | +use Symfony\Component\DependencyInjection\Compiler\DecoratorServicePass; |
23 | 24 | use Symfony\Component\DependencyInjection\Compiler\ResolveChildDefinitionsPass;
|
| 25 | +use Symfony\Component\DependencyInjection\Compiler\ResolveReferencesToAliasesPass; |
24 | 26 | use Symfony\Component\DependencyInjection\ContainerBuilder;
|
25 | 27 | use Symfony\Component\DependencyInjection\Reference;
|
26 | 28 | use Symfony\Component\ExpressionLanguage\Expression;
|
@@ -900,6 +902,25 @@ public function testCustomHasherWithMigrateFrom()
|
900 | 902 | ]);
|
901 | 903 | }
|
902 | 904 |
|
| 905 | + public function testAuthenticatorsStillExistAfterBeingDecorated() |
| 906 | + { |
| 907 | + $container = $this->getRawContainer(); |
| 908 | + $container->setParameter('kernel.debug', true); |
| 909 | + $container->getCompilerPassConfig()->setOptimizationPasses([ |
| 910 | + new ResolveChildDefinitionsPass(), |
| 911 | + new DecoratorServicePass(), |
| 912 | + new ResolveReferencesToAli
9A20
asesPass(), |
| 913 | + ]); |
| 914 | + |
| 915 | + $container->register(TestAuthenticator::class); |
| 916 | + $container->loadFromExtension('security', [ |
| 917 | + 'firewalls' => ['main' => ['custom_authenticator' => TestAuthenticator::class]], |
| 918 | + ]); |
| 919 | + $container->compile(); |
| 920 | + |
| 921 | + $this->assertTrue($container->hasDefinition(TestAuthenticator::class)); |
| 922 | + } |
| 923 | + |
903 | 924 | protected function getRawContainer()
|
904 | 925 | {
|
905 | 926 | $container = new ContainerBuilder();
|
|
0 commit comments