FactoryMock.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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;
  16. use Composer\Repository\RepositoryManager;
  17. use Composer\Installer;
  18. use Composer\IO\IOInterface;
  19. class FactoryMock extends Factory
  20. {
  21. public static function createConfig(IOInterface $io = null)
  22. {
  23. $config = new Config();
  24. $config->merge(array(
  25. 'config' => array('home' => sys_get_temp_dir().'/composer-test'),
  26. 'repositories' => array('packagist' => false),
  27. ));
  28. return $config;
  29. }
  30. protected function addLocalRepository(RepositoryManager $rm, $vendorDir)
  31. {
  32. }
  33. protected function createInstallationManager()
  34. {
  35. return new InstallationManagerMock;
  36. }
  37. protected function createDefaultInstallers(Installer\InstallationManager $im, Composer $composer, IOInterface $io)
  38. {
  39. }
  40. protected function purgePackages(Repository\RepositoryManager $rm, Installer\InstallationManager $im)
  41. {
  42. }
  43. }