FactoryMock.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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\Repository\WritableRepositoryInterface;
  18. use Composer\Installer;
  19. use Composer\IO\IOInterface;
  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' => sys_get_temp_dir().'/composer-test'),
  27. 'repositories' => array('packagist' => false),
  28. ));
  29. return $config;
  30. }
  31. protected function addLocalRepository(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. }