From 1d733ba21aab47360910bde092f5a7d8042bbfc7 Mon Sep 17 00:00:00 2001 From: Luis Faceira Date: Thu, 10 Dec 2015 15:55:50 -0800 Subject: [PATCH] GitDownloaderTest uses temp dir as composer home config When creating a DownloaderMock a home config dir is ensured to exist, so that no test fails for lack of it that on a regular run would be set by the Factory --- src/Composer/Config.php | 1 - tests/Composer/Test/Downloader/GitDownloaderTest.php | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Composer/Config.php b/src/Composer/Config.php index d8da9f215..59306f9d2 100644 --- a/src/Composer/Config.php +++ b/src/Composer/Config.php @@ -59,7 +59,6 @@ class Config 'platform' => array(), 'archive-format' => 'tar', 'archive-dir' => '.', - 'home' => '$HOME' // valid keys without defaults (auth config stuff): // bitbucket-oauth // github-oauth diff --git a/tests/Composer/Test/Downloader/GitDownloaderTest.php b/tests/Composer/Test/Downloader/GitDownloaderTest.php index 1ad627aac..32ab7927e 100644 --- a/tests/Composer/Test/Downloader/GitDownloaderTest.php +++ b/tests/Composer/Test/Downloader/GitDownloaderTest.php @@ -46,6 +46,10 @@ class GitDownloaderTest extends TestCase if (!$config) { $config = new Config(); } + if (!$config->has('home')) { + $tmpDir = realpath(sys_get_temp_dir()).DIRECTORY_SEPARATOR.'cmptest-'.md5(uniqid('', true)); + $config->merge(array('config' => array('home' => $tmpDir))); + } return new GitDownloader($io, $config, $executor, $filesystem); }