2012-05-13 19:40:42 +00:00
|
|
|
<?php
|
2017-03-08 14:07:29 +00:00
|
|
|
|
2012-05-13 19:40:42 +00:00
|
|
|
/*
|
|
|
|
* This file is part of Composer.
|
|
|
|
*
|
|
|
|
* (c) Nils Adermann <naderman@naderman.de>
|
|
|
|
* Jordi Boggiano <j.boggiano@seld.be>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Composer\Test\Mock;
|
|
|
|
|
2012-06-24 18:11:06 +00:00
|
|
|
use Composer\Composer;
|
2012-05-13 19:40:42 +00:00
|
|
|
use Composer\Config;
|
|
|
|
use Composer\Factory;
|
|
|
|
use Composer\Repository\RepositoryManager;
|
2014-12-13 16:14:03 +00:00
|
|
|
use Composer\Repository\WritableRepositoryInterface;
|
2012-05-13 19:40:42 +00:00
|
|
|
use Composer\Installer;
|
2019-11-14 14:20:50 +00:00
|
|
|
use Composer\EventDispatcher\EventDispatcher;
|
2012-05-13 19:40:42 +00:00
|
|
|
use Composer\IO\IOInterface;
|
2018-11-12 14:23:32 +00:00
|
|
|
use Composer\Test\TestCase;
|
2019-01-17 16:12:33 +00:00
|
|
|
use Composer\Util\Loop;
|
2012-05-13 19:40:42 +00:00
|
|
|
|
|
|
|
class FactoryMock extends Factory
|
|
|
|
{
|
2014-12-16 11:12:13 +00:00
|
|
|
public static function createConfig(IOInterface $io = null, $cwd = null)
|
2012-05-13 19:40:42 +00:00
|
|
|
{
|
2014-12-16 11:12:13 +00:00
|
|
|
$config = new Config(true, $cwd);
|
2012-05-13 19:40:42 +00:00
|
|
|
|
2012-06-24 11:03:55 +00:00
|
|
|
$config->merge(array(
|
2016-04-01 11:07:42 +00:00
|
|
|
'config' => array('home' => TestCase::getUniqueTmpDirectory()),
|
2012-06-24 11:03:55 +00:00
|
|
|
'repositories' => array('packagist' => false),
|
|
|
|
));
|
2012-05-13 19:40:42 +00:00
|
|
|
|
|
|
|
return $config;
|
|
|
|
}
|
|
|
|
|
2016-01-10 20:06:10 +00:00
|
|
|
protected function addLocalRepository(IOInterface $io, RepositoryManager $rm, $vendorDir)
|
2012-05-13 19:40:42 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-11-14 14:20:50 +00:00
|
|
|
public function createInstallationManager(Loop $loop, IOInterface $io, EventDispatcher $dispatcher = null)
|
2012-05-13 19:40:42 +00:00
|
|
|
{
|
2019-01-17 16:12:33 +00:00
|
|
|
return new InstallationManagerMock();
|
2012-05-13 19:40:42 +00:00
|
|
|
}
|
|
|
|
|
2012-06-24 18:11:06 +00:00
|
|
|
protected function createDefaultInstallers(Installer\InstallationManager $im, Composer $composer, IOInterface $io)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-12-13 16:14:03 +00:00
|
|
|
protected function purgePackages(WritableRepositoryInterface $repo, Installer\InstallationManager $im)
|
2012-05-13 19:40:42 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|