1
0
Fork 0

Fix build with latest setup-php

pull/10525/head
Jordi Boggiano 2022-02-08 14:54:46 +01:00
parent eefb4644b0
commit 3cb44bc4c0
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 9 additions and 6 deletions

View File

@ -13,6 +13,7 @@
namespace Composer\Test; namespace Composer\Test;
use Composer\Config; use Composer\Config;
use Composer\Util\Platform;
class ConfigTest extends TestCase class ConfigTest extends TestCase
{ {
@ -327,22 +328,24 @@ class ConfigTest extends TestCase
public function testProcessTimeout() public function testProcessTimeout()
{ {
putenv('COMPOSER_PROCESS_TIMEOUT=0'); Platform::putEnv('COMPOSER_PROCESS_TIMEOUT', '0');
$config = new Config(true); $config = new Config(true);
$this->assertEquals(0, $config->get('process-timeout')); $this->assertEquals(0, $config->get('process-timeout'));
putenv('COMPOSER_PROCESS_TIMEOUT'); Platform::clearEnv('COMPOSER_PROCESS_TIMEOUT');
} }
public function testHtaccessProtect() public function testHtaccessProtect()
{ {
putenv('COMPOSER_HTACCESS_PROTECT=0'); Platform::putEnv('COMPOSER_HTACCESS_PROTECT', '0');
$config = new Config(true); $config = new Config(true);
$this->assertEquals(0, $config->get('htaccess-protect')); $this->assertEquals(0, $config->get('htaccess-protect'));
putenv('COMPOSER_HTACCESS_PROTECT'); Platform::clearEnv('COMPOSER_HTACCESS_PROTECT');
} }
public function testGetSourceOfValue() public function testGetSourceOfValue()
{ {
Platform::clearEnv('COMPOSER_PROCESS_TIMEOUT');
$config = new Config; $config = new Config;
$this->assertSame(Config::SOURCE_DEFAULT, $config->getSourceOfValue('process-timeout')); $this->assertSame(Config::SOURCE_DEFAULT, $config->getSourceOfValue('process-timeout'));
@ -357,9 +360,9 @@ class ConfigTest extends TestCase
public function testGetSourceOfValueEnvVariables() public function testGetSourceOfValueEnvVariables()
{ {
putenv('COMPOSER_HTACCESS_PROTECT=0'); Platform::putEnv('COMPOSER_HTACCESS_PROTECT', '0');
$config = new Config; $config = new Config;
$this->assertEquals('COMPOSER_HTACCESS_PROTECT', $config->getSourceOfValue('htaccess-protect')); $this->assertEquals('COMPOSER_HTACCESS_PROTECT', $config->getSourceOfValue('htaccess-protect'));
putenv('COMPOSER_HTACCESS_PROTECT'); Platform::clearEnv('COMPOSER_HTACCESS_PROTECT');
} }
} }