From fb93036a70c9520cab99b46723ebc8f2e6fd82a6 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 28 Jan 2020 14:22:11 +0100 Subject: [PATCH] Fix putenv to avoid leaving the environment in a dirty state --- tests/Composer/Test/EventDispatcher/EventDispatcherTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php b/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php index 04ae56c20..e1c3387b5 100644 --- a/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php +++ b/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php @@ -288,7 +288,7 @@ class EventDispatcherTest extends TestCase rmdir(__DIR__ . sprintf('%svendor', DIRECTORY_SEPARATOR)); chdir($currentDirectoryBkp); - putenv('COMPOSER_BIN_DIR=' . $composerBinDirBkp); + putenv('COMPOSER_BIN_DIR' . ($composerBinDirBkp === false ? '' : '=' . $composerBinDirBkp)); } static public function createsVendorBinFolderChecksEnvDoesNotContainsBin() @@ -296,7 +296,7 @@ class EventDispatcherTest extends TestCase mkdir(__DIR__ . sprintf('%svendor%sbin', DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR), 0700, true); $val = getenv('PATH'); - if ( ! $val ) { + if (!$val) { $val = getenv('Path'); } @@ -307,7 +307,7 @@ class EventDispatcherTest extends TestCase { $val = getenv('PATH'); - if ( ! $val ) { + if (!$val) { $val = getenv('Path'); }