1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

try to use unique test directories

any tests that use the filesystem should have their own unique directory, as we run our test suite in parallel and
cleanup of tests (removing directories) should not interfere with currently running tests
This commit is contained in:
Rob Bast 2016-01-21 13:01:55 +01:00
parent 06a21132db
commit adf3b956d0
25 changed files with 145 additions and 91 deletions

View file

@ -22,6 +22,7 @@ class LibraryInstallerTest extends TestCase
{
protected $composer;
protected $config;
protected $rootDir;
protected $vendorDir;
protected $binDir;
protected $dm;
@ -37,10 +38,11 @@ class LibraryInstallerTest extends TestCase
$this->config = new Config();
$this->composer->setConfig($this->config);
$this->vendorDir = realpath(sys_get_temp_dir()).DIRECTORY_SEPARATOR.'composer-test-vendor';
$this->rootDir = $this->getUniqueTmpDirectory();
$this->vendorDir = $this->rootDir.'/vendor';
$this->ensureDirectoryExistsAndClear($this->vendorDir);
$this->binDir = realpath(sys_get_temp_dir()).DIRECTORY_SEPARATOR.'composer-test-bin';
$this->binDir = $this->rootDir.'/bin';
$this->ensureDirectoryExistsAndClear($this->binDir);
$this->config->merge(array(
@ -61,8 +63,7 @@ class LibraryInstallerTest extends TestCase
protected function tearDown()
{
$this->fs->removeDirectory($this->vendorDir);
$this->fs->removeDirectory($this->binDir);
$this->fs->removeDirectory($this->rootDir);
}
public function testInstallerCreationShouldNotCreateVendorDirectory()