1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00
This commit is contained in:
Jordi Boggiano 2020-11-22 14:48:56 +01:00
parent 152694b574
commit b7d770659b
No known key found for this signature in database
GPG key ID: 7BBD42C429EC80BC
175 changed files with 688 additions and 724 deletions

View file

@ -176,14 +176,11 @@ class RemoteFilesystemTest extends TestCase
$fs->expects($this->once())->method('getRemoteContents')
->willReturnCallback(function ($originUrl, $fileUrl, $ctx, &$http_response_header) {
$http_response_header = array('http/1.1 401 unauthorized');
return '';
});
$file = tempnam(sys_get_temp_dir(), 'z');
unlink($file);
@ -205,30 +202,25 @@ class RemoteFilesystemTest extends TestCase
->method('promptAuthIfNeeded')
->willReturn(array(
'storeAuth' => true,
'retry' => true
'retry' => true,
));
$fs->expects($this->at(0))
->method('getRemoteContents')
->willReturnCallback(function ($originUrl, $fileUrl, $ctx, &$http_response_header) {
$http_response_header = array('http/1.1 401 unauthorized');
return '';
});
$fs->expects($this->at(1))
->method('getRemoteContents')
->willReturnCallback(function ($originUrl, $fileUrl, $ctx, &$http_response_header) {
$http_response_header = array('http/1.1 200 OK');
return '<?php $copied = "Copied"; ';
});
$file = tempnam(sys_get_temp_dir(), 'z');
$copyResult = $fs->copy(
@ -411,7 +403,7 @@ class RemoteFilesystemTest extends TestCase
}
/**
* @param array $mockedMethods
* @param array $mockedMethods
* @param AuthHelper $authHelper
*
* @return RemoteFilesystem|MockObject
@ -424,7 +416,7 @@ class RemoteFilesystemTest extends TestCase
$this->getConfigMock(),
array(),
false,
$authHelper
$authHelper,
))
->setMethods($mockedMethods)
->getMock();
@ -440,7 +432,7 @@ class RemoteFilesystemTest extends TestCase
return $this->getMockBuilder('Composer\Util\AuthHelper')
->setConstructorArgs(array(
$this->getIOInterfaceMock(),
$this->getConfigMock()
$this->getConfigMock(),
))
->setMethods($mockedMethods)
->getMock();