diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php index 6a6b512529..d60da7386c 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php @@ -168,6 +168,31 @@ class SecurityExtensionTest extends TestCase $this->addToAssertionCount(1); } + /** + * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException + * @expectedExceptionMessage Not configuring explicitly the provider for the "http_basic" listener on "ambiguous" firewall is ambiguous as there is more than one registered provider. + */ + public function testMissingProviderForListener() + { + $container = $this->getRawContainer(); + $container->loadFromExtension('security', array( + 'providers' => array( + 'first' => array('id' => 'foo'), + 'second' => array('id' => 'bar'), + ), + + 'firewalls' => array( + 'ambiguous' => array( + 'http_basic' => true, + 'form_login' => array('provider' => 'second'), + 'logout_on_user_change' => true, + ), + ), + )); + + $container->compile(); + } + protected function getRawContainer() { $container = new ContainerBuilder(); diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index cafd87865a..2845613b33 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -120,8 +120,8 @@ class Application try { $exitCode = $this->doRun($input, $output); - } catch (\Throwable $e) { - if (!$this->catchExceptions || !$e instanceof \Exception) { + } catch (\Exception $e) { + if (!$this->catchExceptions) { throw $e; }