do not try to test update inside fixtures
parent
dd4db91ae7
commit
f82c820a32
|
@ -20,6 +20,7 @@ use Composer\Package\Loader\ArrayLoader;
|
||||||
use Composer\Package\PackageInterface;
|
use Composer\Package\PackageInterface;
|
||||||
use Composer\Plugin\PluginManager;
|
use Composer\Plugin\PluginManager;
|
||||||
use Composer\Autoload\AutoloadGenerator;
|
use Composer\Autoload\AutoloadGenerator;
|
||||||
|
use Composer\Util\Filesystem;
|
||||||
|
|
||||||
class PluginInstallerTest extends \PHPUnit_Framework_TestCase
|
class PluginInstallerTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
|
@ -30,13 +31,17 @@ class PluginInstallerTest extends \PHPUnit_Framework_TestCase
|
||||||
protected $repository;
|
protected $repository;
|
||||||
protected $io;
|
protected $io;
|
||||||
protected $autoloadGenerator;
|
protected $autoloadGenerator;
|
||||||
|
protected $directory;
|
||||||
|
|
||||||
protected function setUp()
|
protected function setUp()
|
||||||
{
|
{
|
||||||
$loader = new JsonLoader(new ArrayLoader());
|
$loader = new JsonLoader(new ArrayLoader());
|
||||||
$this->packages = array();
|
$this->packages = array();
|
||||||
|
$this->directory = sys_get_temp_dir() . '/' . uniqid();
|
||||||
for ($i = 1; $i <= 4; $i++) {
|
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')
|
$dm = $this->getMockBuilder('Composer\Downloader\DownloadManager')
|
||||||
|
@ -77,13 +82,18 @@ class PluginInstallerTest extends \PHPUnit_Framework_TestCase
|
||||||
|
|
||||||
$config->merge(array(
|
$config->merge(array(
|
||||||
'config' => array(
|
'config' => array(
|
||||||
'vendor-dir' => __DIR__.'/Fixtures/',
|
'vendor-dir' => $this->directory.'/Fixtures/',
|
||||||
'home' => __DIR__.'/Fixtures',
|
'home' => $this->directory.'/Fixtures',
|
||||||
'bin-dir' => __DIR__.'/Fixtures/bin',
|
'bin-dir' => $this->directory.'/Fixtures/bin',
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function tearDown() {
|
||||||
|
$filesystem = new Filesystem();
|
||||||
|
$filesystem->removeDirectoryPhp($this->directory);
|
||||||
|
}
|
||||||
|
|
||||||
public function testInstallNewPlugin()
|
public function testInstallNewPlugin()
|
||||||
{
|
{
|
||||||
$this->repository
|
$this->repository
|
||||||
|
|
Loading…
Reference in New Issue