@@ -113,21 +113,30 @@ public function testMergeWithDifferentIdentifiersForPlaceholders()
113113 public function testResolveEnvCastsIntToString ()
114114 {
115115 $ 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 );
118118 $ bag ->resolve ();
119- $ this ->assertSame ('2 ' , $ bag ->all ()['env(int) ' ]);
119+ $ this ->assertSame ('2 ' , $ bag ->all ()['env(int_var) ' ]);
120+ }
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) ' ]);
120129 }
121130
122131 /**
123132 * @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.
125134 */
126135 public function testResolveThrowsOnBadDefaultValue ()
127136 {
128137 $ 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 ());
131140 $ bag ->resolve ();
132141 }
133142}
0 commit comments