FactoryMock.php 1.4 KB

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