@@ -113,21 +113,30 @@ public function testMergeWithDifferentIdentifiersForPlaceholders()
113
113
public function testResolveEnvCastsIntToString ()
114
114
{
115
115
$ bag = new EnvPlaceholderParameterBag ();
116
- $ bag ->get ('env(INT ) ' );
117
- $ bag ->set ('env(INT ) ' , 2 );
116
+ $ bag ->get ('env(INT_VAR ) ' );
117
+ $ bag ->set ('env(Int_Var ) ' , 2 );
118
118
$ bag ->resolve ();
119
- $ this ->assertSame ('2 ' , $ bag ->all ()['env(int) ' ]);
119
+ $ this ->assertSame ('2 ' , $ bag ->all ()['env(int_var) ' ]);
120
+ }
DF22
121
+
122
+ public function testResolveEnvAllowsNull ()
123
+ {
124
+ $ bag = new EnvPlaceholderParameterBag ();
125
+ $ bag ->get ('env(NULL_VAR) ' );
126
+ $ bag ->set ('env(Null_Var) ' , null );
127
+ $ bag ->resolve ();
128
+ $ this ->assertNull ($ bag ->all ()['env(null_var) ' ]);
120
129
}
121
130
122
131
/**
123
132
* @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
124
- * @expectedExceptionMessage The default value of env parameter "ARRAY " must be string or null, array given.
133
+ * @expectedExceptionMessage The default value of env parameter "ARRAY_VAR " must be string or null, array given.
125
134
*/
126
135
public function testResolveThrowsOnBadDefaultValue ()
127
136
{
128
137
$ bag = new EnvPlaceholderParameterBag ();
129
- $ bag ->get ('env(ARRAY ) ' );
130
- $ bag ->set ('env(ARRAY ) ' , array ());
138
+ $ bag ->get ('env(ARRAY_VAR ) ' );
139
+ $ bag ->set ('env(Array_Var ) ' , array ());
131
140
$ bag ->resolve ();
132
141
}
133
142
}
0 commit comments