1
0
Fork 0

Fix 5.3.3 build

pull/2070/head
Jordi Boggiano 2013-07-05 00:44:20 +02:00
parent 8766c7072b
commit be235ffc19
2 changed files with 20 additions and 24 deletions

View File

@ -6,10 +6,6 @@ php:
- 5.4 - 5.4
- 5.5 - 5.5
matrix:
allow_failures:
- php: 5.3.3
before_script: before_script:
- echo '' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini - echo '' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
- composer install --dev --prefer-source - composer install --dev --prefer-source

View File

@ -33,6 +33,10 @@ class ArchiveDownloaderTest extends \PHPUnit_Framework_TestCase
public function testProcessUrl() 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'))); $downloader = $this->getMockForAbstractClass('Composer\Downloader\ArchiveDownloader', array($this->getMock('Composer\IO\IOInterface'), $this->getMock('Composer\Config')));
$method = new \ReflectionMethod($downloader, 'processUrl'); $method = new \ReflectionMethod($downloader, 'processUrl');
$method->setAccessible(true); $method->setAccessible(true);
@ -40,15 +44,15 @@ class ArchiveDownloaderTest extends \PHPUnit_Framework_TestCase
$expected = 'https://github.com/composer/composer/zipball/master'; $expected = 'https://github.com/composer/composer/zipball/master';
$url = $method->invoke($downloader, $this->getMock('Composer\Package\PackageInterface'), $expected); $url = $method->invoke($downloader, $this->getMock('Composer\Package\PackageInterface'), $expected);
if (extension_loaded('openssl')) {
$this->assertEquals($expected, $url); $this->assertEquals($expected, $url);
} else {
$this->assertEquals('http://nodeload.github.com/composer/composer/zip/master', $url);
}
} }
public function testProcessUrl2() 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'))); $downloader = $this->getMockForAbstractClass('Composer\Downloader\ArchiveDownloader', array($this->getMock('Composer\IO\IOInterface'), $this->getMock('Composer\Config')));
$method = new \ReflectionMethod($downloader, 'processUrl'); $method = new \ReflectionMethod($downloader, 'processUrl');
$method->setAccessible(true); $method->setAccessible(true);
@ -56,15 +60,15 @@ class ArchiveDownloaderTest extends \PHPUnit_Framework_TestCase
$expected = 'https://github.com/composer/composer/archive/master.tar.gz'; $expected = 'https://github.com/composer/composer/archive/master.tar.gz';
$url = $method->invoke($downloader, $this->getMock('Composer\Package\PackageInterface'), $expected); $url = $method->invoke($downloader, $this->getMock('Composer\Package\PackageInterface'), $expected);
if (extension_loaded('openssl')) {
$this->assertEquals($expected, $url); $this->assertEquals($expected, $url);
} else {
$this->assertEquals('http://nodeload.github.com/composer/composer/tar.gz/master', $url);
}
} }
public function testProcessUrl3() 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'))); $downloader = $this->getMockForAbstractClass('Composer\Downloader\ArchiveDownloader', array($this->getMock('Composer\IO\IOInterface'), $this->getMock('Composer\Config')));
$method = new \ReflectionMethod($downloader, 'processUrl'); $method = new \ReflectionMethod($downloader, 'processUrl');
$method->setAccessible(true); $method->setAccessible(true);
@ -72,11 +76,7 @@ class ArchiveDownloaderTest extends \PHPUnit_Framework_TestCase
$expected = 'https://api.github.com/repos/composer/composer/zipball/master'; $expected = 'https://api.github.com/repos/composer/composer/zipball/master';
$url = $method->invoke($downloader, $this->getMock('Composer\Package\PackageInterface'), $expected); $url = $method->invoke($downloader, $this->getMock('Composer\Package\PackageInterface'), $expected);
if (extension_loaded('openssl')) {
$this->assertEquals($expected, $url); $this->assertEquals($expected, $url);
} else {
$this->assertEquals('http://nodeload.github.com/composer/composer/zip/master', $url);
}
} }
/** /**
@ -84,6 +84,10 @@ class ArchiveDownloaderTest extends \PHPUnit_Framework_TestCase
*/ */
public function testProcessUrlRewriteDist($url) 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'))); $downloader = $this->getMockForAbstractClass('Composer\Downloader\ArchiveDownloader', array($this->getMock('Composer\IO\IOInterface'), $this->getMock('Composer\Config')));
$method = new \ReflectionMethod($downloader, 'processUrl'); $method = new \ReflectionMethod($downloader, 'processUrl');
$method->setAccessible(true); $method->setAccessible(true);
@ -97,11 +101,7 @@ class ArchiveDownloaderTest extends \PHPUnit_Framework_TestCase
->will($this->returnValue('ref')); ->will($this->returnValue('ref'));
$url = $method->invoke($downloader, $package, $url); $url = $method->invoke($downloader, $package, $url);
if (extension_loaded('openssl')) {
$this->assertEquals($expected, $url); $this->assertEquals($expected, $url);
} else {
$this->assertEquals('http://nodeload.github.com/composer/composer/'.$type.'/ref', $url);
}
} }
public function provideUrls() public function provideUrls()