FactoryMock.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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\Installer;
  18. use Composer\EventDispatcher\EventDispatcher;
  19. use Composer\IO\IOInterface;
  20. use Composer\Test\TestCase;
  21. use Composer\Util\Loop;
  22. class FactoryMock extends Factory
  23. {
  24. public static function createConfig(IOInterface $io = null, $cwd = null)
  25. {
  26. $config = new Config(true, $cwd);
  27. $config->merge(array(
  28. 'config' => array('home' => TestCase::getUniqueTmpDirectory()),
  29. 'repositories' => array('packagist' => false),
  30. ));
  31. return $config;
  32. }
  33. protected function addLocalRepository(IOInterface $io, RepositoryManager $rm, $vendorDir)
  34. {
  35. }
  36. public function createInstallationManager(Loop $loop, IOInterface $io, EventDispatcher $dispatcher = null)
  37. {
  38. return new InstallationManagerMock();
  39. }
  40. protected function createDefaultInstallers(Installer\InstallationManager $im, Composer $composer, IOInterface $io)
  41. {
  42. }
  43. protected function purgePackages(WritableRepositoryInterface $repo, Installer\InstallationManager $im)
  44. {
  45. }
  46. }