FactoryMock.php 1.2 KB

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