File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
src/Symfony/Component/Dotenv/Tests Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,28 @@ public function getEnvData()
146
146
return $ tests ;
147
147
}
148
148
149
+ public function testLoad ()
150
+ {
151
+ @mkdir ($ tmpdir = sys_get_temp_dir ().'/dotenv ' );
152
+
153
+ $ path1 = tempnam ($ tmpdir , 'sf- ' );
154
+ $ path2 = tempnam ($ tmpdir , 'sf- ' );
155
+
156
+ file_put_contents ($ path1 , 'FOO=BAR ' );
157
+ file_put_contents ($ path2 , 'BAR=BAZ ' );
158
+
159
+ (new DotEnv ())->load ($ path1 , $ path2 );
160
+
161
+ $ this ->assertSame ('BAR ' , getenv ('FOO ' ));
162
+ $ this ->assertSame ('BAZ ' , getenv ('BAR ' ));
163
+
164
+ putenv ('FOO ' );
165
+ putenv ('BAR ' );
166
+ unlink ($ path1 );
167
+ unlink ($ path2 );
168
+ rmdir ($ tmpdir );
169
+ }
170
+
149
171
/**
150
172
* @expectedException \Symfony\Component\Dotenv\Exception\PathException
151
173
*/
You can’t perform that action at this time.
0 commit comments