diff --git a/src/Composer/Downloader/FileDownloader.php b/src/Composer/Downloader/FileDownloader.php index 8ed0712bf..38b2fe304 100644 --- a/src/Composer/Downloader/FileDownloader.php +++ b/src/Composer/Downloader/FileDownloader.php @@ -103,7 +103,7 @@ class FileDownloader implements DownloaderInterface $retries = 3; while ($retries--) { try { - $this->rfs->copy($hostname, $processedUrl, $fileName, $this->outputProgress); + $this->rfs->copy($hostname, $processedUrl, $fileName, $this->outputProgress, $package->getOptions()); break; } catch (TransportException $e) { // if we got an http response with a proper code, then requesting again will probably not help, abort @@ -132,7 +132,7 @@ class FileDownloader implements DownloaderInterface ) { throw $e; } - $this->rfs->copy($hostname, $processedUrl, $fileName, $this->outputProgress); + $this->rfs->copy($hostname, $processedUrl, $fileName, $this->outputProgress, $package->getOptions()); } else { throw $e; } diff --git a/tests/Composer/Test/Downloader/FileDownloaderTest.php b/tests/Composer/Test/Downloader/FileDownloaderTest.php index 99dcaab18..a6f3f1984 100644 --- a/tests/Composer/Test/Downloader/FileDownloaderTest.php +++ b/tests/Composer/Test/Downloader/FileDownloaderTest.php @@ -89,6 +89,10 @@ class FileDownloaderTest extends \PHPUnit_Framework_TestCase ->method('getDistUrl') ->will($this->returnValue('http://example.com/script.js')) ; + $packageMock->expects($this->atLeastOnce()) + ->method('getOptions') + ->will($this->returnValue(array())) + ; do { $path = sys_get_temp_dir().'/'.md5(time().mt_rand()); @@ -130,6 +134,10 @@ class FileDownloaderTest extends \PHPUnit_Framework_TestCase ->method('getDistUrl') ->will($this->returnValue('http://example.com/script.js')) ; + $packageMock->expects($this->atLeastOnce()) + ->method('getOptions') + ->will($this->returnValue(array())) + ; $packageMock->expects($this->any()) ->method('getDistSha1Checksum') ->will($this->returnValue('invalid')) diff --git a/tests/Composer/Test/Downloader/ZipDownloaderTest.php b/tests/Composer/Test/Downloader/ZipDownloaderTest.php index bbe77d7ee..441777d8c 100644 --- a/tests/Composer/Test/Downloader/ZipDownloaderTest.php +++ b/tests/Composer/Test/Downloader/ZipDownloaderTest.php @@ -30,6 +30,10 @@ class ZipDownloaderTest extends \PHPUnit_Framework_TestCase ->method('getDistUrl') ->will($this->returnValue('file://'.__FILE__)) ; + $packageMock->expects($this->atLeastOnce()) + ->method('getOptions') + ->will($this->returnValue(array())) + ; $io = $this->getMock('Composer\IO\IOInterface'); $config = $this->getMock('Composer\Config');