From a5113d7cd343321ce8bb14f6f0c2733b33475502 Mon Sep 17 00:00:00 2001 From: rxu Date: Tue, 15 Apr 2025 19:42:03 +0700 Subject: [PATCH] [ticket/17496] Correctly restore willReturn() PHPBB-17496 --- tests/update/get_updates_test.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/update/get_updates_test.php b/tests/update/get_updates_test.php index 015afc3131..c756972ae7 100644 --- a/tests/update/get_updates_test.php +++ b/tests/update/get_updates_test.php @@ -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);