8000 [Dotenv] Check required dotenvs by pizzaminded · Pull Request #32729 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Dotenv] Check required dotenvs #32729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Prev Previous commit
Next Next commit
[Dotenv] make sure that _ENV does not have variables that are populat…
…ed/checked
  • Loading branch information
pizzaminded committed Jul 24, 2019
commit 6706afa01135bc319e885db66033488ad3680c37
13 changes: 13 additions & 0 deletions src/Symfony/Component/Dotenv/Tests/DotenvTest.php < 8000 svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy">
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,10 @@ public function testDoNotUsePutenv()
*/
public function testSomeEnvVarsAreMissing()
{
unset($_ENV['FOO']);
unset($_ENV['BAR']);
unset($_ENV['BAZ']);

$dotenv = new Dotenv();
$dotenv->populate(['FOO' => 'foo', 'BAR' => 'bar']);

Expand All @@ -460,6 +464,12 @@ public function testSomeEnvVarsAreMissing()
*/
public function testRequiredEnvsExceptionsContainsAllMissingVariableNames()
{

unset($_ENV['FOO']);
unset($_ENV['BAR']);
unset($_ENV['BAZ']);
unset($_ENV['FOOBAR']);

$dotenv = new Dotenv();
$dotenv->populate(['FOO' => 'foo', 'BAR' => 'bar']);

Expand All @@ -473,6 +483,9 @@ public function testRequiredEnvsExceptionsContainsAllMissingVariableNames()
*/
public function testNothingWillHappenWhenAllEnvVarsAreSet()
{
unset($_ENV['FOO']);
unset($_ENV['BAR']);

$dotenv = new Dotenv();
$dotenv->populate(['FOO' => 'foo', 'BAR' => 'bar']);

Expand Down
0