From d0cb7d6389e37156a39590fc4fb61fff92d3030d Mon Sep 17 00:00:00 2001 From: rxu Date: Tue, 15 Apr 2025 14:57:03 +0700 Subject: [PATCH] [ticket/17496] Fix tests PHPUnit will automatically create a test double of required return type to be returned PHPBB-17496 --- tests/update/get_updates_test.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/update/get_updates_test.php b/tests/update/get_updates_test.php index b21a53659d..015afc3131 100644 --- a/tests/update/get_updates_test.php +++ b/tests/update/get_updates_test.php @@ -68,8 +68,7 @@ class phpbb_update_get_updates_test extends phpbb_test_case ->with('GET', 'http://example.com/update.zip', [ 'sink' => '/path/to/storage', 'allow_redirects' => false - ]) - ->willReturn(true); + ]); $client_reflection = new \ReflectionProperty($this->update, 'http_client'); $client_reflection->setValue($this->update, $this->http_client); @@ -84,7 +83,7 @@ class phpbb_update_get_updates_test extends phpbb_test_case ->method('request') ->willReturnCallback(function ($method, $url, $options) { - throw new ClientException('bad client', new \GuzzleHttp\Psr7\Request($method, $url)); + throw new ClientException('bad client', new \GuzzleHttp\Psr7\Request($method, $url), new \GuzzleHttp\Psr7\Response()); }); $client_reflection = new \ReflectionProperty($this->update, 'http_client'); $client_reflection->setValue($this->update, $this->http_client);