1
0
Fork 0

Skip pear tests when repos are unreachable

pull/1926/head
Jordi Boggiano 2013-05-23 21:51:17 +02:00
parent 950fc7e66e
commit 59bda2bb9b
1 changed files with 7 additions and 1 deletions

View File

@ -32,6 +32,9 @@ class PearRepositoryTest extends TestCase
public function testComposerShouldSetIncludePath() public function testComposerShouldSetIncludePath()
{ {
$url = 'pear.phpmd.org'; $url = 'pear.phpmd.org';
if (!@file_get_contents('http://'.$url)) {
$this->markTestSkipped('Repository '.$url.' appears to be unreachable');
}
$expectedPackages = array( $expectedPackages = array(
array('name' => 'pear-pear.phpmd.org/PHP_PMD', 'version' => '1.3.3'), array('name' => 'pear-pear.phpmd.org/PHP_PMD', 'version' => '1.3.3'),
); );
@ -64,8 +67,11 @@ class PearRepositoryTest extends TestCase
'url' => $url 'url' => $url
); );
$this->createRepository($repoConfig); if (!@file_get_contents('http://'.$url)) {
$this->markTestSkipped('Repository '.$url.' appears to be unreachable');
}
$this->createRepository($repoConfig);
foreach ($expectedPackages as $expectedPackage) { foreach ($expectedPackages as $expectedPackage) {
$this->assertInstanceOf('Composer\Package\PackageInterface', $this->assertInstanceOf('Composer\Package\PackageInterface',
$this->repository->findPackage($expectedPackage['name'], $expectedPackage['version']), $this->repository->findPackage($expectedPackage['name'], $expectedPackage['version']),