mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/12479] Use separate mock in "remote" file test
PHPBB-12479
This commit is contained in:
parent
efff5ac49e
commit
ca56181008
1 changed files with 3 additions and 3 deletions
|
@ -257,11 +257,11 @@ class version_helper_remote_test extends \phpbb_test_case
|
||||||
|
|
||||||
public function test_version_phpbb_com()
|
public function test_version_phpbb_com()
|
||||||
{
|
{
|
||||||
$this->guzzle_mock = $this->getMockBuilder('\GuzzleHttp\Client')
|
$guzzle_mock = $this->getMockBuilder('\GuzzleHttp\Client')
|
||||||
->onlyMethods(['request'])
|
->onlyMethods(['request'])
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$this->guzzle_mock->method('request')
|
$guzzle_mock->method('request')
|
||||||
->will($this->returnCallback(function()
|
->will($this->returnCallback(function()
|
||||||
{
|
{
|
||||||
return new \GuzzleHttp\Psr7\Response(200, [], file_get_contents(__DIR__ . '/fixture/30x.txt'));
|
return new \GuzzleHttp\Psr7\Response(200, [], file_get_contents(__DIR__ . '/fixture/30x.txt'));
|
||||||
|
@ -273,7 +273,7 @@ class version_helper_remote_test extends \phpbb_test_case
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
$file_downloader->method('create_client')
|
$file_downloader->method('create_client')
|
||||||
->willReturn($this->guzzle_mock);
|
->willReturn($guzzle_mock);
|
||||||
|
|
||||||
$hostname = 'version.phpbb.com';
|
$hostname = 'version.phpbb.com';
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue