Fix test and actually check that we get hasAuthentication called for different domains

main
Jordi Boggiano 7 years ago
parent 743153e862
commit 45cd26b2df

@ -247,11 +247,17 @@ class RemoteFilesystemTest extends \PHPUnit_Framework_TestCase
->withAnyParameters()
->willReturn(array());
$domains = array();
$io
->expects($this->any())
->method('hasAuthentication')
->with('bitbucket.org')
->willReturn(true);
->will($this->returnCallback(function($arg) use (&$domains) {
$domains[] = $arg;
// first time is called with bitbucket.org, then it redirects to bbuseruploads.s3.amazonaws.com so next time we have no auth configured
return $arg === 'bitbucket.org';
}));
$io
->expects($this->at(1))
->method('getAuthentication')
->with('bitbucket.org')
->willReturn(array(
@ -266,6 +272,7 @@ class RemoteFilesystemTest extends \PHPUnit_Framework_TestCase
$result = $rfs->getContents($hostname, $url, false);
$this->assertEquals($contents, $result);
$this->assertEquals(array('bitbucket.org', 'bbuseruploads.s3.amazonaws.com'), $domains);
}
protected function callGetOptionsForUrl($io, array $args = array(), array $options = array(), $fileUrl = '')

Loading…
Cancel
Save