[ticket/12479] Use separate mock in "remote" file test

PHPBB-12479
This commit is contained in:
Marc Alexander 2024-07-23 21:25:22 +02:00
parent efff5ac49e
commit ca56181008
No known key found for this signature in database
GPG key ID: 50E0D2423696F995

View file

@ -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';