/**
* Mocks the HTTP client.
*
* @param \GuzzleHttp\Psr7\Response ...
* Variable number of Response objects that the mocked client should return.
*/
protected function mockClient(Response ...
$responses) { // Create a mock and queue responses.
$mock_handler =
new MockHandler($responses);
$handler_stack = HandlerStack::
create($mock_handler);
$history = Middleware::
history($this->history
);
$handler_stack->
push($history);
$this->mockHttpClient =
new Client(['handler' =>
$handler_stack]);
} /**
* @covers ::doRequest
* @covers ::fetchProjectData
*/
public function testUpdateFetcherNoFallback() { // First, try without the HTTP fallback setting, and HTTPS mocked to fail.
$settings =
new Settings([]);