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:
parent
06a21132db
commit
adf3b956d0
25 changed files with 145 additions and 91 deletions
|
@ -25,15 +25,15 @@ class CacheTest extends TestCase
|
|||
$this->markTestSkipped('Test causes intermittent failures on Travis');
|
||||
}
|
||||
|
||||
$this->root = sys_get_temp_dir() . '/composer_testdir';
|
||||
$this->ensureDirectoryExistsAndClear($this->root);
|
||||
|
||||
$this->root = $this->getUniqueTmpDirectory();
|
||||
$this->files = array();
|
||||
$zeros = str_repeat('0', 1000);
|
||||
|
||||
for ($i = 0; $i < 4; $i++) {
|
||||
file_put_contents("{$this->root}/cached.file{$i}.zip", $zeros);
|
||||
$this->files[] = new \SplFileInfo("{$this->root}/cached.file{$i}.zip");
|
||||
}
|
||||
|
||||
$this->finder = $this->getMockBuilder('Symfony\Component\Finder\Finder')->disableOriginalConstructor()->getMock();
|
||||
|
||||
$io = $this->getMock('Composer\IO\IOInterface');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue