فهرست منبع

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
Luis Faceira 9 سال پیش
والد
کامیت
1d733ba21a
2فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 0 1
      src/Composer/Config.php
  2. 4 0
      tests/Composer/Test/Downloader/GitDownloaderTest.php

+ 0 - 1
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

+ 4 - 0
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);
     }