Skip to content

Commit 23f7098

Browse files
author
Romain Pierre
committed
Fixes the valid placeholder types for variable node
1 parent 41ece70 commit 23f7098

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)