Skip to content

Commit 7a33b01

Browse files
minor symfony#25128 [SecurityBundle][Console] Remove dead code, add missing test (chalasr)
This PR was merged into the 4.0 branch. Discussion ---------- [SecurityBundle][Console] Remove dead code, add missing test | Q | A | ------------- | --- | Branch? | 4.0 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Commits ------- 190df1a Remove dead code, add missing test
2 parents 38ddcef + 190df1a commit 7a33b01

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,31 @@ public function testPerListenerProvider()
168168
$this->addToAssertionCount(1);
169169
}
170170

171+
/**
172+
* @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
173+
* @expectedExceptionMessage Not configuring explicitly the provider for the "http_basic" listener on "ambiguous" firewall is ambiguous as there is more than one registered provider.
174+
*/
175+
public function testMissingProviderForListener()
176+
{
177+
$container = $this->getRawContainer();
178+
$container->loadFromExtension('security', array(
179+
'providers' => array(
180+
'first' => array('id' => 'foo'),
181+
'second' => array('id' => 'bar'),
182+
),
183+
184+
'firewalls' => array(
185+
'ambiguous' => array(
186+
'http_basic' => true,
187+
'form_login' => array('provider' => 'second'),
188+
'logout_on_user_change' => true,
189+
),
190+
),
191+
));
192+
193+
$container->compile();
194+
}
195+
171196
protected function getRawContainer()
172197
{
173198
$container = new ContainerBuilder();

src/Symfony/Component/Console/Application.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ public function run(InputInterface $input = null, OutputInterface $output = null
120120

121121
try {
122122
$exitCode = $this->doRun($input, $output);
123-
} catch (\Throwable $e) {
124-
if (!$this->catchExceptions || !$e instanceof \Exception) {
123+
} catch (\Exception $e) {
124+
if (!$this->catchExceptions) {
125125
throw $e;
126126
}
127127

0 commit comments

Comments
 (0)