Prevent auto-registration of UserPasswordEncoderCommand

This commit is contained in:
Robin Chalas 2017-05-22 18:25:24 +02:00
parent 82ec56b40c
commit b39b35b95d
2 changed files with 9 additions and 4 deletions

View File

@ -98,11 +98,11 @@ class SecurityExtension extends Extension
if ($config['encoders']) {
$this->createEncoders($config['encoders'], $container);
}
if (class_exists(Application::class)) {
$loader->load('console.xml');
$container->getDefinition('security.console.user_password_encoder_command')->replaceArgument(1, array_keys($config['encoders']));
}
if (class_exists(Application::class)) {
$loader->load('console.xml');
$container->getDefinition('security.console.user_password_encoder_command')->replaceArgument(1, array_keys($config['encoders']));
}
// load ACL

View File

@ -345,6 +345,11 @@ abstract class CompleteConfigurationTest extends TestCase
$this->assertEquals('security.user_checker', $this->getContainer('container1')->getAlias('security.user_checker.secure'));
}
public function testUserPasswordEncoderCommandIsRegistered()
{
$this->assertTrue($this->getContainer('remember_me_options')->has('security.console.user_password_encoder_command'));
}
protected function getContainer($file)
{
$file = $file.'.'.$this->getFileExtension();