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;
|
2020-06-19 15:56:13 +00:00
|
|
|
use Composer\Package\Version\VersionGuesser;
|
|
|
|
use Composer\Package\Version\VersionParser;
|
2020-04-19 14:00:21 +00:00
|
|
|
use Composer\Package\RootPackageInterface;
|
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;
|
2020-06-04 13:30:20 +00:00
|
|
|
use Composer\Util\ProcessExecutor;
|
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;
|
|
|
|
}
|
|
|
|
|
2020-06-19 15:56:13 +00:00
|
|
|
protected function loadRootPackage(RepositoryManager $rm, Config $config, VersionParser $parser, VersionGuesser $guesser, IOInterface $io)
|
|
|
|
{
|
|
|
|
return new \Composer\Package\Loader\RootPackageLoader($rm, $config, $parser, new VersionGuesserMock(), $io);
|
|
|
|
}
|
|
|
|
|
2021-07-12 11:54:01 +00:00
|
|
|
protected function addLocalRepository(IOInterface $io, RepositoryManager $rm, $vendorDir, RootPackageInterface $rootPackage, ProcessExecutor $process = null)
|
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
|
|
|
}
|
|
|
|
|
2020-06-04 13:30:20 +00:00
|
|
|
protected function createDefaultInstallers(Installer\InstallationManager $im, Composer $composer, IOInterface $io, ProcessExecutor $process = null)
|
2012-06-24 18:11:06 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-12-13 16:14:03 +00:00
|
|
|
protected function purgePackages(WritableRepositoryInterface $repo, Installer\InstallationManager $im)
|
2012-05-13 19:40:42 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|