Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdabecde

Browse files
committed
[Dotenv] Test load() with multiple paths
1 parent035d526 commitdabecde

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

‎src/Symfony/Component/Dotenv/Tests/DotenvTest.php‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,28 @@ public function getEnvData()
146146
return$tests;
147147
}
148148

149+
publicfunctiontestLoad()
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+
(newDotEnv())->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+
149171
/**
150172
* @expectedException \Symfony\Component\Dotenv\Exception\PathException
151173
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp