Skip to content
This repository was archived by the owner on Jan 8, 2024. It is now read-only.

Commit 463a6aa

Browse files
committed
Fix up CI. PHP 7.4+
1 parent b3a6823 commit 463a6aa

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Diff for: tests/ClientTest.php

+8-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Http\Adapter\Cake\Tests;
44

5+
use Cake\Http\Client as CakeClient;
56
use Cake\Http\Client\Response;
67
use Cake\Http\ServerRequest;
78
use Http\Adapter\Cake\Client;
@@ -25,17 +26,20 @@ public function testSendRequest(): void
2526
{
2627
$serverRequest = new ServerRequest();
2728

28-
$client = new Client();
29+
$cakeClient = $this->createClientMock();
30+
$cakeClient->expects($this->once())->method('send')->willReturn(new Response());
31+
32+
$client = new Client($cakeClient);
2933
$response = $client->sendRequest($serverRequest);
3034

3135
$this->assertInstanceOf(Response::class, $response);
3236
}
3337

3438
/**
35-
* @return \Http\Adapter\Cake\Client|\PHPUnit\Framework\MockObject\MockObject
39+
* @return \Cake\Http\Client|\PHPUnit\Framework\MockObject\MockObject
3640
*/
37-
protected function createHttpAdapterMock(): Client
41+
protected function createClientMock(): CakeClient
3842
{
39-
return $this->getMockBuilder(Client::class)->getMock();
43+
return $this->getMockBuilder(CakeClient::class)->onlyMethods(['send'])->getMock();
4044
}
4145
}

0 commit comments

Comments
 (0)