1
0
Fork 0

Merge branch 'fabpot-process-timeout-fix'

* fabpot-process-timeout-fix:
  remove env variable after test assertion
  Fix process timeout when set to 0
pull/5708/head
Rob Bast 2016-09-21 11:34:53 +02:00
commit 22100b21ee
No known key found for this signature in database
GPG Key ID: 73076E35E6165F39
2 changed files with 10 additions and 1 deletions

View File

@ -211,7 +211,8 @@ class Config
// convert foo-bar to COMPOSER_FOO_BAR and check if it exists since it overrides the local config // convert foo-bar to COMPOSER_FOO_BAR and check if it exists since it overrides the local config
$env = 'COMPOSER_' . strtoupper(strtr($key, '-', '_')); $env = 'COMPOSER_' . strtoupper(strtr($key, '-', '_'));
$val = rtrim($this->process($this->getComposerEnv($env) ?: $this->config[$key], $flags), '/\\'); $val = $this->getComposerEnv($env);
$val = rtrim($this->process(false !== $val ? $val : $this->config[$key], $flags), '/\\');
$val = Platform::expandPath($val); $val = Platform::expandPath($val);
if (substr($key, -4) !== '-dir') { if (substr($key, -4) !== '-dir') {

View File

@ -291,4 +291,12 @@ class ConfigTest extends \PHPUnit_Framework_TestCase
); );
$this->assertTrue($config->get('disable-tls')); $this->assertTrue($config->get('disable-tls'));
} }
public function testProcessTimeout()
{
putenv('COMPOSER_PROCESS_TIMEOUT=0');
$config = new Config(true);
$this->assertEquals(0, $config->get('process-timeout'));
putenv('COMPOSER_PROCESS_TIMEOUT');
}
} }