From 4600deac68ff159443f9344a189a7bb013aab0b8 Mon Sep 17 00:00:00 2001 From: Rob Bast Date: Wed, 17 Feb 2016 10:06:10 +0100 Subject: [PATCH] fix #4925 --- tests/Composer/Test/Package/Archiver/ZipArchiverTest.php | 4 ++++ tests/Composer/Test/Repository/RepositoryManagerTest.php | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/Composer/Test/Package/Archiver/ZipArchiverTest.php b/tests/Composer/Test/Package/Archiver/ZipArchiverTest.php index 13168573a..ff556a507 100644 --- a/tests/Composer/Test/Package/Archiver/ZipArchiverTest.php +++ b/tests/Composer/Test/Package/Archiver/ZipArchiverTest.php @@ -19,6 +19,10 @@ class ZipArchiverTest extends ArchiverTest public function testZipArchive() { + if (!class_exists('ZipArchive')) { + $this->markTestSkipped('Cannot run ZipArchiverTest, missing class "ZipArchive".'); + } + // Set up repository $this->setupDummyRepo(); $package = $this->setupPackage(); diff --git a/tests/Composer/Test/Repository/RepositoryManagerTest.php b/tests/Composer/Test/Repository/RepositoryManagerTest.php index 0a419be6c..13e51fb18 100644 --- a/tests/Composer/Test/Repository/RepositoryManagerTest.php +++ b/tests/Composer/Test/Repository/RepositoryManagerTest.php @@ -72,16 +72,21 @@ class RepositoryManagerTest extends TestCase public function creationCases() { - return array( + $cases = array( array('composer', array('url' => 'http://example.org')), array('vcs', array('url' => 'http://github.com/foo/bar')), array('git', array('url' => 'http://github.com/foo/bar')), array('git', array('url' => 'git@example.org:foo/bar.git')), array('svn', array('url' => 'svn://example.org/foo/bar')), array('pear', array('url' => 'http://pear.example.org/foo')), - array('artifact', array('url' => '/path/to/zips')), array('package', array('package' => array())), array('invalid', array(), 'InvalidArgumentException'), ); + + if (class_exists('ZipArchive')) { + $cases[] = array('artifact', array('url' => '/path/to/zips')); + } + + return $cases; } }