Skip to content

Commit f88c243

Browse files
committed
replace deprecated calls to getMock in unit tests
1 parent 6768670 commit f88c243

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

Tests/Unit/ClientFactory/BuzzFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class BuzzFactoryTest extends \PHPUnit_Framework_TestCase
1313
{
1414
public function testCreateClient()
1515
{
16-
$factory = new BuzzFactory($this->getMock(MessageFactory::class));
16+
$factory = new BuzzFactory($this->getMockBuilder(MessageFactory::class)->getMock());
1717
$client = $factory->createClient();
1818

1919
$this->assertInstanceOf(Client::class, $client);

Tests/Unit/ClientFactory/CurlFactoryTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ class CurlFactoryTest extends \PHPUnit_Framework_TestCase
1414
{
1515
public function testCreateClient()
1616
{
17-
$factory = new CurlFactory($this->getMock(MessageFactory::class), $this->getMock(StreamFactory::class));
17+
$factory = new CurlFactory(
18+
$this->getMockBuilder(MessageFactory::class)->getMock(),
19+
$this->getMockBuilder(StreamFactory::class)->getMock()
20+
);
1821
$client = $factory->createClient();
1922

2023
$this->assertInstanceOf(Client::class, $client);

Tests/Unit/ClientFactory/ReactFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class ReactFactoryTest extends \PHPUnit_Framework_TestCase
1313
{
1414
public function testCreateClient()
1515
{
16-
$factory = new ReactFactory($this->getMock(MessageFactory::class));
16+
$factory = new ReactFactory($this->getMockBuilder(MessageFactory::class)->getMock());
1717
$client = $factory->createClient();
1818

1919
$this->assertInstanceOf(Client::class, $client);

Tests/Unit/ClientFactory/SocketFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class SocketFactoryTest extends \PHPUnit_Framework_TestCase
1313
{
1414
public function testCreateClient()
1515
{
16-
$factory = new SocketFactory($this->getMock(MessageFactory::class));
16+
$factory = new SocketFactory($this->getMockBuilder(MessageFactory::class)->getMock());
1717
$client = $factory->createClient();
1818

1919
$this->assertInstanceOf(Client::class, $client);

Tests/Unit/Discovery/ConfiguredClientsStrategyTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ class ConfiguredClientsStrategyTest extends \PHPUnit_Framework_TestCase
1010
{
1111
public function testGetCandidates()
1212
{
13-
$httpClient = $this->getMock(HttpClient::class);
14-
$httpAsyncClient = $this->getMock(HttpAsyncClient::class);
13+
$httpClient = $this->getMockBuilder(HttpClient::class)->getMock();
14+
$httpAsyncClient = $this->getMockBuilder(HttpAsyncClient::class)->getMock();
1515
$strategy = new ConfiguredClientsStrategy($httpClient, $httpAsyncClient);
1616

1717
$candidates = $strategy::getCandidates(HttpClient::class);
@@ -36,7 +36,7 @@ public function testGetCandidatesEmpty()
3636

3737
public function testGetCandidatesEmptyAsync()
3838
{
39-
$httpClient = $this->getMock(HttpClient::class);
39+
$httpClient = $this->getMockBuilder(HttpClient::class)->getMock();
4040
$strategy = new ConfiguredClientsStrategy($httpClient, null);
4141

4242
$candidates = $strategy::getCandidates(HttpClient::class);
@@ -49,7 +49,7 @@ public function testGetCandidatesEmptyAsync()
4949

5050
public function testGetCandidatesEmptySync()
5151
{
52-
$httpAsyncClient = $this->getMock(HttpAsyncClient::class);
52+
$httpAsyncClient = $this->getMockBuilder(HttpAsyncClient::class)->getMock();
5353
$strategy = new ConfiguredClientsStrategy(null, $httpAsyncClient);
5454

5555
$candidates = $strategy::getCandidates(HttpClient::class);

0 commit comments

Comments
 (0)