Skip to content

Commit 82f87fa

Browse files
Merge branch '4.4' into 5.1
* 4.4: Use createMock() and use import instead of FQCN
2 parents 9e0289f + d8df50f commit 82f87fa

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Tests/MockHttpClientTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ protected function getHttpClient(string $testCase): HttpClientInterface
258258
break;
259259

260260
case 'testDnsError':
261-
$mock = $this->getMockBuilder(ResponseInterface::class)->getMock();
261+
$mock = $this->createMock(ResponseInterface::class);
262262
$mock->expects($this->any())
263263
->method('getStatusCode')
264264
->willThrowException(new TransportException('DSN error'));
@@ -281,7 +281,7 @@ protected function getHttpClient(string $testCase): HttpClientInterface
281281
break;
282282

283283
case 'testTimeoutOnAccess':
284-
$mock = $this->getMockBuilder(ResponseInterface::class)->getMock();
284+
$mock = $this->createMock(ResponseInterface::class);
285285
$mock->expects($this->any())
286286
->method('getHeaders')
287287
->willThrowException(new TransportException('Timeout'));
@@ -348,7 +348,7 @@ protected function getHttpClient(string $testCase): HttpClientInterface
348348
break;
349349

350350
case 'testMaxDuration':
351-
$mock = $this->getMockBuilder(ResponseInterface::class)->getMock();
351+
$mock = $this->createMock(ResponseInterface::class);
352352
$mock->expects($this->any())
353353
->method('getContent')
354354
->willReturnCallback(static function (): void {

Tests/TraceableHttpClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static function setUpBeforeClass(): void
2929

3030
public function testItTracesRequest()
3131
{
32-
$httpClient = $this->getMockBuilder(HttpClientInterface::class)->getMock();
32+
$httpClient = $this->createMock(HttpClientInterface::class);
3333
$httpClient
3434
->expects($this->once())
3535
->method('request')

0 commit comments

Comments
 (0)