Skip to content

Commit

Permalink
Make tests more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Feb 15, 2022
1 parent f808e49 commit 6698317
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/Composer/Test/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,16 +330,20 @@ public function testProcessTimeout()
{
Platform::putEnv('COMPOSER_PROCESS_TIMEOUT', '0');
$config = new Config(true);
$this->assertEquals(0, $config->get('process-timeout'));
$result = $config->get('process-timeout');
Platform::clearEnv('COMPOSER_PROCESS_TIMEOUT');

$this->assertEquals(0, $result);
}

public function testHtaccessProtect()
{
Platform::putEnv('COMPOSER_HTACCESS_PROTECT', '0');
$config = new Config(true);
$this->assertEquals(0, $config->get('htaccess-protect'));
$result = $config->get('htaccess-protect');
Platform::clearEnv('COMPOSER_HTACCESS_PROTECT');

$this->assertEquals(0, $result);
}

public function testGetSourceOfValue()
Expand All @@ -362,7 +366,9 @@ public function testGetSourceOfValueEnvVariables()
{
Platform::putEnv('COMPOSER_HTACCESS_PROTECT', '0');
$config = new Config;
$this->assertEquals('COMPOSER_HTACCESS_PROTECT', $config->getSourceOfValue('htaccess-protect'));
$result = $config->getSourceOfValue('htaccess-protect');
Platform::clearEnv('COMPOSER_HTACCESS_PROTECT');

$this->assertEquals('COMPOSER_HTACCESS_PROTECT', $result);
}
}

0 comments on commit 6698317

Please sign in to comment.