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()
196
196
$ this ->assertSame ($ expected , $ container ->resolveEnvPlaceholders ($ ext ->getConfig ()));
197
197
}
198
198
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
+
199
212
private function doProcess (ContainerBuilder $ container ): void
200
213
{
201
214
(new MergeExtensionConfigurationPass ())->process ($ container );
@@ -213,6 +226,7 @@ public function getConfigTreeBuilder()
213
226
$ rootNode
214
227
->children ()
215
228
->scalarNode ('scalar_node ' )->end ()
229
+ ->scalarNode ('scalar_node_not_empty ' )->cannotBeEmpty ()->end ()
216
230
->integerNode ('int_node ' )->end ()
217
231
->floatNode ('float_node ' )->end ()
218
232
->booleanNode ('bool_node ' )->end ()
You can’t perform that action at this time.
0 commit comments