Fix misresolved parameters in debug:config on 3.2

This commit is contained in:
Robin Chalas 2016-12-13 19:24:48 +01:00
parent 5f0f842cf9
commit c88bc899d4
No known key found for this signature in database
GPG Key ID: 89672113756EE03B
4 changed files with 22 additions and 4 deletions

View File

@ -83,7 +83,7 @@ EOF
$configs = $container->resolveEnvPlaceholders($container->getParameterBag()->resolveValue($configs));
$processor = new Processor();
$config = $processor->processConfiguration($configuration, $configs);
$config = $container->resolveEnvPlaceholders($container->getParameterBag()->resolveValue($processor->processConfiguration($configuration, $configs)));
if (null === $path = $input->getArgument('path')) {
$io->title(
@ -105,7 +105,7 @@ EOF
$io->title(sprintf('Current configuration for "%s.%s"', $extensionAlias, $path));
$io->writeln(Yaml::dump($container->getParameterBag()->resolveValue($config), 10));
$io->writeln(Yaml::dump($config, 10));
}
private function compileContainer()
@ -130,7 +130,7 @@ EOF
*
* @return mixed
*/
private function getConfigForPath(array $config = array(), $path, $alias)
private function getConfigForPath(array $config, $path, $alias)
{
$steps = explode('.', $path);

View File

@ -48,6 +48,16 @@ class ConfigDebugCommandTest extends WebTestCase
$this->assertContains('foo', $tester->getDisplay());
}
public function testParametersValuesAreResolved()
{
$tester = $this->createCommandTester();
$ret = $tester->execute(array('name' => 'framework'));
$this->assertSame(0, $ret, 'Returns 0 in case of success');
$this->assertContains("locale: '%env(LOCALE)%'", $tester->getDisplay());
$this->assertContains('secret: test', $tester->getDisplay());
}
public function testDumpUndefinedBundleOption()
{
$tester = $this->createCommandTester();

View File

@ -1,2 +1,10 @@
imports:
- { resource: ../config/default.yml }
framework:
secret: '%secret%'
default_locale: '%env(LOCALE)%'
parameters:
env(LOCALE): en
secret: test

View File

@ -19,7 +19,7 @@
"php": ">=5.5.9",
"symfony/cache": "~3.2",
"symfony/class-loader": "~3.2",
"symfony/dependency-injection": "~3.2",
"symfony/dependency-injection": "~3.2.1|~3.3",
"symfony/config": "~2.8|~3.0",
"symfony/event-dispatcher": "~2.8|~3.0",
"symfony/http-foundation": "~3.1",