RepositoryFactoryTest.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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\Repository;
  12. use Composer\Repository\RepositoryFactory;
  13. use Composer\Test\TestCase;
  14. class RepositoryFactoryTest extends TestCase
  15. {
  16. public function testManagerWithAllRepositoryTypes()
  17. {
  18. $manager = RepositoryFactory::manager(
  19. $this->getMockBuilder('Composer\IO\IOInterface')->getMock(),
  20. $this->getMockBuilder('Composer\Config')->getMock()
  21. );
  22. $ref = new \ReflectionProperty($manager, 'repositoryClasses');
  23. $ref->setAccessible(true);
  24. $repositoryClasses = $ref->getValue($manager);
  25. $this->assertEquals(array(
  26. 'composer',
  27. 'vcs',
  28. 'package',
  29. 'pear',
  30. 'git',
  31. 'git-bitbucket',
  32. 'github',
  33. 'gitlab',
  34. 'svn',
  35. 'fossil',
  36. 'perforce',
  37. 'hg',
  38. 'hg-bitbucket',
  39. 'artifact',
  40. 'path',
  41. ), array_keys($repositoryClasses));
  42. }
  43. }