From 472c8a5113876494e19f412e6c5a4ccf112611dd Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 30 Sep 2014 15:17:53 +0100 Subject: [PATCH] Fix tests on windows, fixes #3141 --- tests/Composer/Test/ConfigTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Composer/Test/ConfigTest.php b/tests/Composer/Test/ConfigTest.php index 5afbabffa..705fe78e0 100644 --- a/tests/Composer/Test/ConfigTest.php +++ b/tests/Composer/Test/ConfigTest.php @@ -115,7 +115,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $config->merge(array('config' => array('a' => 'b', 'c' => '{$a}'))); $config->merge(array('config' => array('bin-dir' => '$HOME', 'cache-dir' => '~/foo/'))); - $home = rtrim(getenv('HOME'), '\\/'); + $home = rtrim(getenv('HOME') ?: getenv('USERPROFILE'), '\\/'); $this->assertEquals('b', $config->get('c')); $this->assertEquals($home.'/', $config->get('bin-dir')); $this->assertEquals($home.'/foo', $config->get('cache-dir'));