From be235ffc19f9a76500a69c4bd156ab86a278ad7b Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 5 Jul 2013 00:44:20 +0200 Subject: [PATCH] Fix 5.3.3 build --- .travis.yml | 4 -- .../Test/Downloader/ArchiveDownloaderTest.php | 40 +++++++++---------- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/.travis.yml b/.travis.yml index 24140e48a..a897f3cee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,10 +6,6 @@ php: - 5.4 - 5.5 -matrix: - allow_failures: - - php: 5.3.3 - before_script: - echo '' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini - composer install --dev --prefer-source diff --git a/tests/Composer/Test/Downloader/ArchiveDownloaderTest.php b/tests/Composer/Test/Downloader/ArchiveDownloaderTest.php index 9fd1efb0d..d593e743b 100644 --- a/tests/Composer/Test/Downloader/ArchiveDownloaderTest.php +++ b/tests/Composer/Test/Downloader/ArchiveDownloaderTest.php @@ -33,6 +33,10 @@ class ArchiveDownloaderTest extends \PHPUnit_Framework_TestCase public function testProcessUrl() { + if (extension_loaded('openssl')) { + $this->markTestSkipped('Requires openssl'); + } + $downloader = $this->getMockForAbstractClass('Composer\Downloader\ArchiveDownloader', array($this->getMock('Composer\IO\IOInterface'), $this->getMock('Composer\Config'))); $method = new \ReflectionMethod($downloader, 'processUrl'); $method->setAccessible(true); @@ -40,15 +44,15 @@ class ArchiveDownloaderTest extends \PHPUnit_Framework_TestCase $expected = 'https://github.com/composer/composer/zipball/master'; $url = $method->invoke($downloader, $this->getMock('Composer\Package\PackageInterface'), $expected); - if (extension_loaded('openssl')) { - $this->assertEquals($expected, $url); - } else { - $this->assertEquals('http://nodeload.github.com/composer/composer/zip/master', $url); - } + $this->assertEquals($expected, $url); } public function testProcessUrl2() { + if (extension_loaded('openssl')) { + $this->markTestSkipped('Requires openssl'); + } + $downloader = $this->getMockForAbstractClass('Composer\Downloader\ArchiveDownloader', array($this->getMock('Composer\IO\IOInterface'), $this->getMock('Composer\Config'))); $method = new \ReflectionMethod($downloader, 'processUrl'); $method->setAccessible(true); @@ -56,15 +60,15 @@ class ArchiveDownloaderTest extends \PHPUnit_Framework_TestCase $expected = 'https://github.com/composer/composer/archive/master.tar.gz'; $url = $method->invoke($downloader, $this->getMock('Composer\Package\PackageInterface'), $expected); - if (extension_loaded('openssl')) { - $this->assertEquals($expected, $url); - } else { - $this->assertEquals('http://nodeload.github.com/composer/composer/tar.gz/master', $url); - } + $this->assertEquals($expected, $url); } public function testProcessUrl3() { + if (extension_loaded('openssl')) { + $this->markTestSkipped('Requires openssl'); + } + $downloader = $this->getMockForAbstractClass('Composer\Downloader\ArchiveDownloader', array($this->getMock('Composer\IO\IOInterface'), $this->getMock('Composer\Config'))); $method = new \ReflectionMethod($downloader, 'processUrl'); $method->setAccessible(true); @@ -72,11 +76,7 @@ class ArchiveDownloaderTest extends \PHPUnit_Framework_TestCase $expected = 'https://api.github.com/repos/composer/composer/zipball/master'; $url = $method->invoke($downloader, $this->getMock('Composer\Package\PackageInterface'), $expected); - if (extension_loaded('openssl')) { - $this->assertEquals($expected, $url); - } else { - $this->assertEquals('http://nodeload.github.com/composer/composer/zip/master', $url); - } + $this->assertEquals($expected, $url); } /** @@ -84,6 +84,10 @@ class ArchiveDownloaderTest extends \PHPUnit_Framework_TestCase */ public function testProcessUrlRewriteDist($url) { + if (extension_loaded('openssl')) { + $this->markTestSkipped('Requires openssl'); + } + $downloader = $this->getMockForAbstractClass('Composer\Downloader\ArchiveDownloader', array($this->getMock('Composer\IO\IOInterface'), $this->getMock('Composer\Config'))); $method = new \ReflectionMethod($downloader, 'processUrl'); $method->setAccessible(true); @@ -97,11 +101,7 @@ class ArchiveDownloaderTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue('ref')); $url = $method->invoke($downloader, $package, $url); - if (extension_loaded('openssl')) { - $this->assertEquals($expected, $url); - } else { - $this->assertEquals('http://nodeload.github.com/composer/composer/'.$type.'/ref', $url); - } + $this->assertEquals($expected, $url); } public function provideUrls()