FactoryMock.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /*
  3. * This file is part of Composer.
  4. *
  5. * (c) Nils Adermann <naderman@naderman.de>
  6. * Jordi Boggiano <j.boggiano@seld.be>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace Composer\Test\Mock;
  12. use Composer\Composer;
  13. use Composer\Config;
  14. use Composer\Factory;
  15. use Composer\Repository\RepositoryManager;
  16. use Composer\Repository\WritableRepositoryInterface;
  17. use Composer\Package\RootPackageInterface;
  18. use Composer\Installer;
  19. use Composer\EventDispatcher\EventDispatcher;
  20. use Composer\IO\IOInterface;
  21. use Composer\Test\TestCase;
  22. use Composer\Util\Loop;
  23. class FactoryMock extends Factory
  24. {
  25. public static function createConfig(IOInterface $io = null, $cwd = null)
  26. {
  27. $config = new Config(true, $cwd);
  28. $config->merge(array(
  29. 'config' => array('home' => TestCase::getUniqueTmpDirectory()),
  30. 'repositories' => array('packagist' => false),
  31. ));
  32. return $config;
  33. }
  34. protected function addLocalRepository(IOInterface $io, RepositoryManager $rm, $vendorDir, RootPackageInterface $rootPackage)
  35. {
  36. }
  37. public function createInstallationManager(Loop $loop, IOInterface $io, EventDispatcher $dispatcher = null)
  38. {
  39. return new InstallationManagerMock();
  40. }
  41. protected function createDefaultInstallers(Installer\InstallationManager $im, Composer $composer, IOInterface $io)
  42. {
  43. }
  44. protected function purgePackages(WritableRepositoryInterface $repo, Installer\InstallationManager $im)
  45. {
  46. }
  47. }