From 3cb44bc4c0037b32b7eda631b7373ba6d89d163a Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 8 Feb 2022 14:54:46 +0100 Subject: [PATCH] Fix build with latest setup-php --- tests/Composer/Test/ConfigTest.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/Composer/Test/ConfigTest.php b/tests/Composer/Test/ConfigTest.php index 06f655721..fdf2587a3 100644 --- a/tests/Composer/Test/ConfigTest.php +++ b/tests/Composer/Test/ConfigTest.php @@ -13,6 +13,7 @@ namespace Composer\Test; use Composer\Config; +use Composer\Util\Platform; class ConfigTest extends TestCase { @@ -327,22 +328,24 @@ class ConfigTest extends TestCase public function testProcessTimeout() { - putenv('COMPOSER_PROCESS_TIMEOUT=0'); + Platform::putEnv('COMPOSER_PROCESS_TIMEOUT', '0'); $config = new Config(true); $this->assertEquals(0, $config->get('process-timeout')); - putenv('COMPOSER_PROCESS_TIMEOUT'); + Platform::clearEnv('COMPOSER_PROCESS_TIMEOUT'); } public function testHtaccessProtect() { - putenv('COMPOSER_HTACCESS_PROTECT=0'); + Platform::putEnv('COMPOSER_HTACCESS_PROTECT', '0'); $config = new Config(true); $this->assertEquals(0, $config->get('htaccess-protect')); - putenv('COMPOSER_HTACCESS_PROTECT'); + Platform::clearEnv('COMPOSER_HTACCESS_PROTECT'); } public function testGetSourceOfValue() { + Platform::clearEnv('COMPOSER_PROCESS_TIMEOUT'); + $config = new Config; $this->assertSame(Config::SOURCE_DEFAULT, $config->getSourceOfValue('process-timeout')); @@ -357,9 +360,9 @@ class ConfigTest extends TestCase public function testGetSourceOfValueEnvVariables() { - putenv('COMPOSER_HTACCESS_PROTECT=0'); + Platform::putEnv('COMPOSER_HTACCESS_PROTECT', '0'); $config = new Config; $this->assertEquals('COMPOSER_HTACCESS_PROTECT', $config->getSourceOfValue('htaccess-protect')); - putenv('COMPOSER_HTACCESS_PROTECT'); + Platform::clearEnv('COMPOSER_HTACCESS_PROTECT'); } }