1
0
Fork 0
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:
Niels Keurentjes 2016-04-13 02:02:50 +02:00
parent f5422a441d
commit c9534d48c1
5 changed files with 11 additions and 14 deletions

View file

@ -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'));
}