mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/17496] Correctly restore willReturn()
PHPBB-17496
This commit is contained in:
parent
0f94e1cb13
commit
a5113d7cd3
1 changed files with 4 additions and 1 deletions
|
@ -13,6 +13,7 @@
|
|||
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Exception\ClientException;
|
||||
use GuzzleHttp\Psr7\Response;
|
||||
use phpbb\filesystem\exception\filesystem_exception;
|
||||
use phpbb\filesystem\filesystem_interface;
|
||||
use phpbb\update\get_updates;
|
||||
|
@ -63,12 +64,14 @@ class phpbb_update_get_updates_test extends phpbb_test_case
|
|||
|
||||
public function test_download_success()
|
||||
{
|
||||
$response_mock = $this->createMock(Response::class);
|
||||
$this->http_client->expects($this->once())
|
||||
->method('request')
|
||||
->with('GET', 'http://example.com/update.zip', [
|
||||
'sink' => '/path/to/storage',
|
||||
'allow_redirects' => false
|
||||
]);
|
||||
])
|
||||
->willReturn($response_mock);
|
||||
|
||||
$client_reflection = new \ReflectionProperty($this->update, 'http_client');
|
||||
$client_reflection->setValue($this->update, $this->http_client);
|
||||
|
|
Loading…
Add table
Reference in a new issue