Add temp composer home for GitDriver test using cache
parent
f51aa4fad6
commit
836986faf3
|
@ -25,12 +25,14 @@ use Composer\Config;
|
||||||
*/
|
*/
|
||||||
class VcsRepositoryTest extends \PHPUnit_Framework_TestCase
|
class VcsRepositoryTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
|
private static $composerHome;
|
||||||
private static $gitRepo;
|
private static $gitRepo;
|
||||||
private $skipped;
|
private $skipped;
|
||||||
|
|
||||||
protected function initialize()
|
protected function initialize()
|
||||||
{
|
{
|
||||||
$oldCwd = getcwd();
|
$oldCwd = getcwd();
|
||||||
|
self::$composerHome = sys_get_temp_dir() . '/composer-home-'.mt_rand().'/';
|
||||||
self::$gitRepo = sys_get_temp_dir() . '/composer-git-'.mt_rand().'/';
|
self::$gitRepo = sys_get_temp_dir() . '/composer-git-'.mt_rand().'/';
|
||||||
|
|
||||||
$locator = new ExecutableFinder();
|
$locator = new ExecutableFinder();
|
||||||
|
@ -125,6 +127,7 @@ class VcsRepositoryTest extends \PHPUnit_Framework_TestCase
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass()
|
||||||
{
|
{
|
||||||
$fs = new Filesystem;
|
$fs = new Filesystem;
|
||||||
|
$fs->removeDirectory(self::$composerHome);
|
||||||
$fs->removeDirectory(self::$gitRepo);
|
$fs->removeDirectory(self::$gitRepo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,7 +143,13 @@ class VcsRepositoryTest extends \PHPUnit_Framework_TestCase
|
||||||
'dev-master' => true,
|
'dev-master' => true,
|
||||||
);
|
);
|
||||||
|
|
||||||
$repo = new VcsRepository(array('url' => self::$gitRepo, 'type' => 'vcs'), new NullIO, new Config());
|
$config = new Config();
|
||||||
|
$config->merge(array(
|
||||||
|
'config' => array(
|
||||||
|
'home' => self::$composerHome,
|
||||||
|
),
|
||||||
|
));
|
||||||
|
$repo = new VcsRepository(array('url' => self::$gitRepo, 'type' => 'vcs'), new NullIO, $config);
|
||||||
$packages = $repo->getPackages();
|
$packages = $repo->getPackages();
|
||||||
$dumper = new ArrayDumper();
|
$dumper = new ArrayDumper();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue