mirror of
https://github.com/composer/composer
synced 2025-05-10 17:12:51 +00:00
Config: add source option for command to show where a config value is loaded from (#10129)
This commit is contained in:
parent
012556daee
commit
44c5b6cde6
7 changed files with 113 additions and 17 deletions
|
@ -340,4 +340,26 @@ class ConfigTest extends TestCase
|
|||
$this->assertEquals(0, $config->get('htaccess-protect'));
|
||||
putenv('COMPOSER_HTACCESS_PROTECT');
|
||||
}
|
||||
|
||||
public function testGetSourceOfValue()
|
||||
{
|
||||
$config = new Config;
|
||||
|
||||
$this->assertSame(Config::SOURCE_DEFAULT, $config->getSourceOfValue('process-timeout'));
|
||||
|
||||
$config->merge(
|
||||
array('config' => array('process-timeout' => 1)),
|
||||
'phpunit-test'
|
||||
);
|
||||
|
||||
$this->assertSame('phpunit-test', $config->getSourceOfValue('process-timeout'));
|
||||
}
|
||||
|
||||
public function testGetSourceOfValueEnvVariables()
|
||||
{
|
||||
putenv('COMPOSER_HTACCESS_PROTECT=0');
|
||||
$config = new Config;
|
||||
$this->assertEquals('COMPOSER_HTACCESS_PROTECT', $config->getSourceOfValue('htaccess-protect'));
|
||||
putenv('COMPOSER_HTACCESS_PROTECT');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue