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

Appearance settings

Commit 5552808

Browse filesBrowse files
committed
minor #31405 [Dotenv] Test do not use putenv (xuanquynh)
This PR was merged into the 4.3-dev branch. Discussion ---------- [Dotenv] Test do not use putenv | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | The related pull request is #31062. If the `$usePutenv` flag is set to `false`, `putenv` won't be executed. I just add a small test for this situation. Commits ------- 6d1a76e Test do not use putenv
2 parents e387854 + 6d1a76e commit 5552808
Copy full SHA for 5552808

File tree

1 file changed

+10
-0
lines changed
Filter options

1 file changed

+10
-0
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Dotenv/Tests/DotenvTest.php
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,4 +431,14 @@ public function testNoDeprecationWarning()
431431
$dotenv = new Dotenv(false);
432432
$this->assertInstanceOf(Dotenv::class, $dotenv);
433433
}
434+
435+
public function testDoNotUsePutenv()
436+
{
437+
$dotenv = new Dotenv(false);
438+
$dotenv->populate(['TEST_USE_PUTENV' => 'no']);
439+
440+
$this->assertSame('no', $_SERVER['TEST_USE_PUTENV']);
441+
$this->assertSame('no', $_ENV['TEST_USE_PUTENV']);
442+
$this->assertFalse(getenv('TEST_USE_PUTENV'));
443+
}
434444
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.