From f82c820a32e468c20fa8061989814c51f1407762 Mon Sep 17 00:00:00 2001 From: Karoly Negyesi Date: Fri, 20 Sep 2013 05:39:35 +0200 Subject: [PATCH] do not try to test update inside fixtures --- .../Test/Plugin/PluginInstallerTest.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/Composer/Test/Plugin/PluginInstallerTest.php b/tests/Composer/Test/Plugin/PluginInstallerTest.php index 3b64f2699..4163c0f2e 100644 --- a/tests/Composer/Test/Plugin/PluginInstallerTest.php +++ b/tests/Composer/Test/Plugin/PluginInstallerTest.php @@ -20,6 +20,7 @@ use Composer\Package\Loader\ArrayLoader; use Composer\Package\PackageInterface; use Composer\Plugin\PluginManager; use Composer\Autoload\AutoloadGenerator; +use Composer\Util\Filesystem; class PluginInstallerTest extends \PHPUnit_Framework_TestCase { @@ -30,13 +31,17 @@ class PluginInstallerTest extends \PHPUnit_Framework_TestCase protected $repository; protected $io; protected $autoloadGenerator; + protected $directory; protected function setUp() { $loader = new JsonLoader(new ArrayLoader()); $this->packages = array(); + $this->directory = sys_get_temp_dir() . '/' . uniqid(); for ($i = 1; $i <= 4; $i++) { - $this->packages[] = $loader->load(__DIR__.'/Fixtures/plugin-v'.$i.'/composer.json'); + $filename = '/Fixtures/plugin-v'.$i.'/composer.json'; + mkdir(dirname($this->directory . $filename), 0777, TRUE); + $this->packages[] = $loader->load(__DIR__ . $filename); } $dm = $this->getMockBuilder('Composer\Downloader\DownloadManager') @@ -77,13 +82,18 @@ class PluginInstallerTest extends \PHPUnit_Framework_TestCase $config->merge(array( 'config' => array( - 'vendor-dir' => __DIR__.'/Fixtures/', - 'home' => __DIR__.'/Fixtures', - 'bin-dir' => __DIR__.'/Fixtures/bin', + 'vendor-dir' => $this->directory.'/Fixtures/', + 'home' => $this->directory.'/Fixtures', + 'bin-dir' => $this->directory.'/Fixtures/bin', ), )); } + protected function tearDown() { + $filesystem = new Filesystem(); + $filesystem->removeDirectoryPhp($this->directory); + } + public function testInstallNewPlugin() { $this->repository