mirror of
https://github.com/composer/composer
synced 2025-05-10 17:12:51 +00:00
Made env variable parsing in path replacements generic across platforms and replaced old config.php implementation.
This commit is contained in:
parent
f5422a441d
commit
c9534d48c1
5 changed files with 11 additions and 14 deletions
|
@ -24,11 +24,8 @@ class PlatformTest extends \PHPUnit_Framework_TestCase
|
|||
public function testExpandPath()
|
||||
{
|
||||
putenv('TESTENV=/home/test');
|
||||
if (Platform::isWindows()) {
|
||||
$this->assertEquals('/home/test/myPath', Platform::expandPath('%TESTENV%/myPath'));
|
||||
} else {
|
||||
$this->assertEquals('/home/test/myPath', Platform::expandPath('$TESTENV/myPath'));
|
||||
}
|
||||
$this->assertEquals('/home/test/myPath', Platform::expandPath('%TESTENV%/myPath'));
|
||||
$this->assertEquals('/home/test/myPath', Platform::expandPath('$TESTENV/myPath'));
|
||||
$this->assertEquals((getenv('HOME') ?: getenv('USERPROFILE')) . '/test', Platform::expandPath('~/test'));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue