|
@@ -30,16 +30,15 @@ class LibraryInstallerTest extends \PHPUnit_Framework_TestCase
|
|
|
$this->fs = new Filesystem;
|
|
|
|
|
|
$this->vendorDir = realpath(sys_get_temp_dir()).DIRECTORY_SEPARATOR.'composer-test-vendor';
|
|
|
- if (is_dir($this->vendorDir)) {
|
|
|
- $this->fs->removeDirectory($this->vendorDir);
|
|
|
+ if (!is_dir($this->vendorDir)) {
|
|
|
+ mkdir($this->vendorDir);
|
|
|
}
|
|
|
- mkdir($this->vendorDir);
|
|
|
+
|
|
|
|
|
|
$this->binDir = realpath(sys_get_temp_dir()).DIRECTORY_SEPARATOR.'composer-test-bin';
|
|
|
- if (is_dir($this->binDir)) {
|
|
|
- $this->fs->removeDirectory($this->binDir);
|
|
|
+ if (!is_dir($this->binDir)) {
|
|
|
+ mkdir($this->binDir);
|
|
|
}
|
|
|
- mkdir($this->binDir);
|
|
|
|
|
|
$this->dm = $this->getMockBuilder('Composer\Downloader\DownloadManager')
|
|
|
->disableOriginalConstructor()
|
|
@@ -52,6 +51,16 @@ class LibraryInstallerTest extends \PHPUnit_Framework_TestCase
|
|
|
->getMock();
|
|
|
}
|
|
|
|
|
|
+ protected function tearDown() {
|
|
|
+ if (is_dir($this->vendorDir)) {
|
|
|
+ $this->fs->removeDirectory($this->vendorDir);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (is_dir($this->binDir)) {
|
|
|
+ $this->fs->removeDirectory($this->binDir);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public function testInstallerCreationShouldNotCreateVendorDirectory()
|
|
|
{
|
|
|
$this->fs->removeDirectory($this->vendorDir);
|