Fix test and actually check that we get hasAuthentication called for different domains
parent
743153e862
commit
45cd26b2df
|
@ -247,11 +247,17 @@ class RemoteFilesystemTest extends \PHPUnit_Framework_TestCase
|
||||||
->withAnyParameters()
|
->withAnyParameters()
|
||||||
->willReturn(array());
|
->willReturn(array());
|
||||||
|
|
||||||
|
$domains = array();
|
||||||
$io
|
$io
|
||||||
|
->expects($this->any())
|
||||||
->method('hasAuthentication')
|
->method('hasAuthentication')
|
||||||
->with('bitbucket.org')
|
->will($this->returnCallback(function($arg) use (&$domains) {
|
||||||
->willReturn(true);
|
$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
|
$io
|
||||||
|
->expects($this->at(1))
|
||||||
->method('getAuthentication')
|
->method('getAuthentication')
|
||||||
->with('bitbucket.org')
|
->with('bitbucket.org')
|
||||||
->willReturn(array(
|
->willReturn(array(
|
||||||
|
@ -266,6 +272,7 @@ class RemoteFilesystemTest extends \PHPUnit_Framework_TestCase
|
||||||
$result = $rfs->getContents($hostname, $url, false);
|
$result = $rfs->getContents($hostname, $url, false);
|
||||||
|
|
||||||
$this->assertEquals($contents, $result);
|
$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 = '')
|
protected function callGetOptionsForUrl($io, array $args = array(), array $options = array(), $fileUrl = '')
|
||||||
|
|
Loading…
Reference in New Issue