FactoryMock.php 1.4 KB

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