Skip to content

Commit 22cb1a7

Browse files
Merge branch '5.1' into 5.2
* 5.1: Use createMock() and use import instead of FQCN
2 parents b458d19 + 82f87fa commit 22cb1a7

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
@@ -267,7 +267,7 @@ protected function getHttpClient(string $testCase): HttpClientInterface
267267
break;
268268

269269
case 'testDnsError':
270-
$mock = $this->getMockBuilder(ResponseInterface::class)->getMock();
270+
$mock = $this->createMock(ResponseInterface::class);
271271
$mock->expects($this->any())
272272
->method('getStatusCode')
273273
->willThrowException(new TransportException('DSN error'));
@@ -290,7 +290,7 @@ protected function getHttpClient(string $testCase): HttpClientInterface
290290
break;
291291

292292
case 'testTimeoutOnAccess':
293-
$mock = $this->getMockBuilder(ResponseInterface::class)->getMock();
293+
$mock = $this->createMock(ResponseInterface::class);
294294
$mock->expects($this->any())
295295
->method('getHeaders')
296296
->willThrowException(new TransportException('Timeout'));
@@ -357,7 +357,7 @@ protected function getHttpClient(string $testCase): HttpClientInterface
357357
break;
358358

359359
case 'testMaxDuration':
360-
$mock = $this->getMockBuilder(ResponseInterface::class)->getMock();
360+
$mock = $this->createMock(ResponseInterface::class);
361361
$mock->expects($this->any())
362362
->method('getContent')
363363
->willReturnCallback(static function (): void {

Tests/TraceableHttpClientTest.php

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

3232
public function testItTracesRequest()
3333
{
34-
$httpClient = $this->getMockBuilder(HttpClientInterface::class)->getMock();
34+
$httpClient = $this->createMock(HttpClientInterface::class);
3535
$httpClient
3636
->expects($this->any())
3737
->method('request')

0 commit comments

Comments
 (0)