1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-29 13:00:26 +02:00

[ticket/17496] Fix tests

PHPUnit will automatically create a test double
of required return type to be returned

PHPBB-17496
This commit is contained in:
rxu
2025-04-15 14:57:03 +07:00
parent 118ab73c37
commit d0cb7d6389

View File

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