minor #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
This commit is contained in:
commit
7a33b017e9
@ -168,6 +168,31 @@ class SecurityExtensionTest extends TestCase
|
|||||||
$this->addToAssertionCount(1);
|
$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()
|
protected function getRawContainer()
|
||||||
{
|
{
|
||||||
$container = new ContainerBuilder();
|
$container = new ContainerBuilder();
|
||||||
|
@ -120,8 +120,8 @@ class Application
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$exitCode = $this->doRun($input, $output);
|
$exitCode = $this->doRun($input, $output);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Exception $e) {
|
||||||
if (!$this->catchExceptions || !$e instanceof \Exception) {
|
if (!$this->catchExceptions) {
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user