File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,19 @@ public function testEnvIsNotUnset()
196196 $ this ->assertSame ($ expected , $ container ->resolveEnvPlaceholders ($ ext ->getConfig ()));
197197 }
198198
199+ public function testEmptyEnvWithCannotBeEmptyForScalarNode (): void
200+ {
201+ $ container = new ContainerBuilder ();
202+ $ container ->registerExtension ($ ext = new EnvExtension ());
203+ $ container ->prependExtensionConfig ('env_extension ' , $ expected = array (
204+ 'scalar_node_not_empty ' => '%env(SOME)% ' ,
205+ ));
206+
207+ $ this ->doProcess ($ container );
208+
209+ $ this ->assertSame ($ expected , $ container ->resolveEnvPlaceholders ($ ext ->getConfig ()));
210+ }
211+
199212 private function doProcess (ContainerBuilder $ container ): void
200213 {
201214 (new MergeExtensionConfigurationPass ())->process ($ container );
@@ -213,6 +226,7 @@ public function getConfigTreeBuilder()
213226 $ rootNode
214227 ->children ()
215228 ->scalarNode ('scalar_node ' )->end ()
229+ ->scalarNode ('scalar_node_not_empty ' )->cannotBeEmpty ()->end ()
216230 ->integerNode ('int_node ' )->end ()
217231 ->floatNode ('float_node ' )->end ()
218232 ->booleanNode ('bool_node ' )->end ()
You can’t perform that action at this time.
0 commit comments