diff --git a/src/Symfony/Bridge/PhpUnit/TextUI/TestRunner.php b/src/Symfony/Bridge/PhpUnit/TextUI/TestRunner.php index 2d3259759b..27865be46b 100644 --- a/src/Symfony/Bridge/PhpUnit/TextUI/TestRunner.php +++ b/src/Symfony/Bridge/PhpUnit/TextUI/TestRunner.php @@ -32,9 +32,16 @@ class TestRunner extends BaseRunner */ protected function handleConfiguration(array &$arguments) { - $arguments['listeners'] = isset($arguments['listeners']) ? $arguments['listeners'] : array(); - $arguments['listeners'][] = new SymfonyTestsListener(); + $listener = new SymfonyTestsListener(); - return parent::handleConfiguration($arguments); + $result = parent::handleConfiguration($arguments); + + $arguments['listeners'] = isset($arguments['listeners']) ? $arguments['listeners'] : array(); + + if (!array_filter($arguments['listeners'], function ($listener) { return $listener instanceof SymfonyTestsListener; })) { + $arguments['listeners'][] = $listener; + } + + return $result; } } diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php index a04e29973a..f59ad4e5b3 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php @@ -234,16 +234,6 @@ class SecurityExtension extends Extension $firewalls = $config['firewalls']; $providerIds = $this->createUserProviders($config, $container); - // make the ContextListener aware of the configured user providers - $definition = $container->getDefinition('security.context_listener'); - $arguments = $definition->getArguments(); - $userProviders = array(); - foreach ($providerIds as $userProviderId) { - $userProviders[] = new Reference($userProviderId); - } - $arguments[1] = $userProviders; - $definition->setArguments($arguments); - // load firewall map $mapDef = $container->getDefinition('security.firewall.map'); $map = $authenticationProviders = $contextRefs = array(); @@ -327,7 +317,7 @@ class SecurityExtension extends Extension $contextKey = $firewall['context']; } - $listeners[] = new Reference($this->createContextListener($container, $contextKey)); + $listeners[] = new Reference($this->createContextListener($container, $contextKey, $defaultProvider)); } $config->replaceArgument(6, $contextKey); @@ -436,7 +426,7 @@ class SecurityExtension extends Extension return array($matcher, $listeners, $exceptionListener); } - private function createContextListener($container, $contextKey) + private function createContextListener($container, $contextKey, $providerId) { if (isset($this->contextListeners[$contextKey])) { return $this->contextListeners[$contextKey]; @@ -444,6 +434,7 @@ class SecurityExtension extends Extension $listenerId = 'security.context_listener.'.count($this->contextListeners); $listener = $container->setDefinition($listenerId, new ChildDefinition('security.context_listener')); + $listener->replaceArgument(1, array(new Reference($providerId))); $listener->replaceArgument(2, $contextKey); return $this->contextListeners[$contextKey] = $listenerId; diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig index aef89183cd..69872418cf 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_item.html.twig @@ -1,4 +1,4 @@ -