1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Add slow tests to slow group, excluded by default except for travis

This commit is contained in:
Jordi Boggiano 2012-05-06 15:10:13 +02:00
parent b1eb47bdd0
commit 6967ec16b3
7 changed files with 50 additions and 13 deletions

View file

@ -21,23 +21,26 @@ use Composer\Util\ProcessExecutor;
use Composer\IO\NullIO;
use Composer\Config;
/**
* @group slow
*/
class VcsRepositoryTest extends \PHPUnit_Framework_TestCase
{
private static $gitRepo;
private static $skipped;
private $skipped;
public static function setUpBeforeClass()
protected function initialize()
{
$oldCwd = getcwd();
self::$gitRepo = sys_get_temp_dir() . '/composer-git-'.rand().'/';
$locator = new ExecutableFinder();
if (!$locator->find('git')) {
self::$skipped = 'This test needs a git binary in the PATH to be able to run';
$this->skipped = 'This test needs a git binary in the PATH to be able to run';
return;
}
if (!mkdir(self::$gitRepo) || !chdir(self::$gitRepo)) {
self::$skipped = 'Could not create and move into the temp git repo '.self::$gitRepo;
$this->skipped = 'Could not create and move into the temp git repo '.self::$gitRepo;
return;
}
@ -101,8 +104,11 @@ class VcsRepositoryTest extends \PHPUnit_Framework_TestCase
public function setUp()
{
if (self::$skipped) {
$this->markTestSkipped(self::$skipped);
if (!self::$gitRepo) {
$this->initialize();
}
if ($this->skipped) {
$this->markTestSkipped($this->skipped);
}
}