Remove dead code, add missing test

This commit is contained in:
Robin Chalas 2017-11-23 10:03:09 +01:00
parent ae3b5de58d
commit 190df1ab4b
2 changed files with 27 additions and 2 deletions

View File

@ -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();

View File

@ -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;
}