2016-06-25 01:09:49 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of Composer.
|
|
|
|
*
|
|
|
|
* (c) Nils Adermann <naderman@naderman.de>
|
|
|
|
* Jordi Boggiano <j.boggiano@seld.be>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Composer\Test\Repository\Vcs;
|
|
|
|
|
|
|
|
use Composer\Repository\Vcs\FossilDriver;
|
|
|
|
use Composer\Config;
|
2018-11-12 14:23:32 +00:00
|
|
|
use Composer\Test\TestCase;
|
2016-06-25 01:09:49 +00:00
|
|
|
use Composer\Util\Filesystem;
|
|
|
|
use Composer\Util\Platform;
|
|
|
|
|
|
|
|
class FossilDriverTest extends TestCase
|
|
|
|
{
|
|
|
|
protected $home;
|
|
|
|
protected $config;
|
|
|
|
|
|
|
|
public function setUp()
|
|
|
|
{
|
|
|
|
$this->home = $this->getUniqueTmpDirectory();
|
|
|
|
$this->config = new Config();
|
|
|
|
$this->config->merge(array(
|
|
|
|
'config' => array(
|
|
|
|
'home' => $this->home,
|
|
|
|
),
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function tearDown()
|
|
|
|
{
|
|
|
|
$fs = new Filesystem();
|
|
|
|
$fs->removeDirectory($this->home);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function supportProvider()
|
|
|
|
{
|
|
|
|
return array(
|
|
|
|
array('http://fossil.kd2.org/kd2fw/', true),
|
|
|
|
array('https://chiselapp.com/user/rkeene/repository/flint/index', true),
|
|
|
|
array('ssh://fossil.kd2.org/kd2fw.fossil', true),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider supportProvider
|
|
|
|
*/
|
|
|
|
public function testSupport($url, $assertion)
|
|
|
|
{
|
|
|
|
$config = new Config();
|
2018-04-12 08:24:56 +00:00
|
|
|
$result = FossilDriver::supports($this->getMockBuilder('Composer\IO\IOInterface')->getMock(), $config, $url);
|
2016-06-25 01:09:49 +00:00
|
|
|
$this->assertEquals($assertion, $result);
|
|
|
|
}
|
|
|
|
}
|