Skip to content

Commit c82be55

Browse files
committed
bug #26895 [Config] Fixes the valid placeholder types for variable node (romain-pierre)
This PR was merged into the 4.1-dev branch. Discussion ---------- [Config] Fixes the valid placeholder types for variable node | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | we will see... <!-- please add some, will be required by reviewers --> | Fixed tickets | #26894 | License | MIT This is a proposition, still in discussion. <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> Commits ------- 9fbdcdbeb9 Fixes the valid placeholder types for variable node
2 parents c5cf9de + 23f7098 commit c82be55

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Tests/Compiler/ValidateEnvPlaceholdersPassTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,19 @@ public function testEmptyEnvWhichCannotBeEmptyForScalarNode(): void
209209
$this->assertSame($expected, $container->resolveEnvPlaceholders($ext->getConfig()));
210210
}
211211

212+
public function testEnvWithVariableNode(): void
213+
{
214+
$container = new ContainerBuilder();
215+
$container->registerExtension($ext = new EnvExtension());
216+
$container->prependExtensionConfig('env_extension', $expected = array(
217+
'variable_node' => '%env(SOME)%',
218+
));
219+
220+
$this->doProcess($container);
221+
222+
$this->assertSame($expected, $container->resolveEnvPlaceholders($ext->getConfig()));
223+
}
224+
212225
private function doProcess(ContainerBuilder $container): void
213226
{
214227
(new MergeExtensionConfigurationPass())->process($container);
@@ -247,6 +260,7 @@ public function getConfigTreeBuilder()
247260
->end()
248261
->arrayNode('simple_array_node')->end()
249262
->enumNode('enum_node')->values(array('a', 'b'))->end()
263+
->variableNode('variable_node')->end()
250264
->end();
251265

252266
return $treeBuilder;

0 commit comments

Comments
 (0)