FossilDriverTest.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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\Vcs;
  12. use Composer\Repository\Vcs\FossilDriver;
  13. use Composer\Config;
  14. use Composer\Test\TestCase;
  15. use Composer\Util\Filesystem;
  16. use Composer\Util\Platform;
  17. class FossilDriverTest extends TestCase
  18. {
  19. protected $home;
  20. protected $config;
  21. public function setUp()
  22. {
  23. $this->home = $this->getUniqueTmpDirectory();
  24. $this->config = new Config();
  25. $this->config->merge(array(
  26. 'config' => array(
  27. 'home' => $this->home,
  28. ),
  29. ));
  30. }
  31. public function tearDown()
  32. {
  33. $fs = new Filesystem();
  34. $fs->removeDirectory($this->home);
  35. }
  36. public static function supportProvider()
  37. {
  38. return array(
  39. array('http://fossil.kd2.org/kd2fw/', true),
  40. array('https://chiselapp.com/user/rkeene/repository/flint/index', true),
  41. array('ssh://fossil.kd2.org/kd2fw.fossil', true),
  42. );
  43. }
  44. /**
  45. * @dataProvider supportProvider
  46. */
  47. public function testSupport($url, $assertion)
  48. {
  49. $config = new Config();
  50. $result = FossilDriver::supports($this->getMockBuilder('Composer\IO\IOInterface')->getMock(), $config, $url);
  51. $this->assertEquals($assertion, $result);
  52. }
  53. }