1
0
Fork 0
composer/tests/Composer/Test/Repository/Vcs/HgDriverTest.php

68 lines
1.7 KiB
PHP
Raw Normal View History

<?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\HgDriver;
use Composer\Test\TestCase;
use Composer\Util\Filesystem;
use Composer\Config;
class HgDriverTest extends TestCase
{
/** @type \Composer\IO\IOInterface|\PHPUnit_Framework_MockObject_MockObject */
private $io;
2016-10-03 11:35:48 +00:00
/** @type Config */
private $config;
/** @type string */
private $home;
public function setUp()
{
$this->io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock();
$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);
}
2016-10-03 11:35:48 +00:00
/**
* @dataProvider supportsDataProvider
*/
public function testSupports($repositoryUrl)
{
$this->assertTrue(
2016-10-03 11:35:48 +00:00
HgDriver::supports($this->io, $this->config, $repositoryUrl)
);
2016-10-03 11:35:48 +00:00
}
2016-10-03 11:35:48 +00:00
public function supportsDataProvider()
{
return array(
array('ssh://bitbucket.org/user/repo'),
array('ssh://hg@bitbucket.org/user/repo'),
array('ssh://user@bitbucket.org/user/repo'),
array('https://bitbucket.org/user/repo'),
array('https://user@bitbucket.org/user/repo'),
);
}
}