Skip to content

Commit 1fef2ac

Browse files
committed
Replace deprecated phpunit calls with latest
1 parent 99cdda5 commit 1fef2ac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+102
-119
lines changed

tests/Phue/Test/BridgeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class BridgeTest extends \PHPUnit_Framework_TestCase
2323
public function setUp()
2424
{
2525
// Mock client
26-
$this->mockClient = $this->getMock('\Phue\Client',
26+
$this->mockClient = $this->createMock('\Phue\Client',
2727
array(
2828
'sendCommand'
2929
), array(

tests/Phue/Test/ClientTest.php

+11-11
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function testGetSetUsername()
6262
public function testGetBridge()
6363
{
6464
// Mock transport
65-
$mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
65+
$mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
6666
array(
6767
'sendRequest'
6868
));
@@ -87,7 +87,7 @@ public function testGetBridge()
8787
public function testGetUsers()
8888
{
8989
// Mock transport
90-
$mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
90+
$mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
9191
array(
9292
'sendRequest'
9393
));
@@ -127,7 +127,7 @@ public function testGetUsers()
127127
public function testGetLights()
128128
{
129129
// Mock transport
130-
$mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
130+
$mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
131131
array(
132132
'sendRequest'
133133
));
@@ -168,7 +168,7 @@ public function testGetLights()
168168
public function testGetGroups()
169169
{
170170
// Mock transport
171-
$mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
171+
$mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
172172
array(
173173
'sendRequest'
174174
));
@@ -209,7 +209,7 @@ public function testGetGroups()
209209
public function testGetSchedules()
210210
{
211211
// Mock transport
212-
$mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
212+
$mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
213213
array(
214214
'sendRequest'
215215
));
@@ -247,7 +247,7 @@ public function testGetSchedules()
247247
public function testGetScenes()
248248
{
249249
// Mock transport
250-
$mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
250+
$mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
251251
array(
252252
'sendRequest'
253253
));
@@ -290,7 +290,7 @@ public function testGetScenes()
290290
public function testGetSensors()
291291
{
292292
// Mock transport
293-
$mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
293+
$mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
294294
array(
295295
'sendRequest'
296296
));
@@ -327,7 +327,7 @@ public function testGetSensors()
327327
public function testGetRules()
328328
{
329329
// Mock transport
330-
$mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
330+
$mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
331331
array(
332332
'sendRequest'
333333
));
@@ -364,7 +364,7 @@ public function testGetRules()
364364
public function testGetTimezones()
365365
{
366366
// Mock transport
367-
$mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
367+
$mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
368368
array(
369369
'sendRequest',
370370
'sendRequestBypassBodyValidation'
@@ -409,7 +409,7 @@ public function testInstantiateDefaultTransport()
409409
public function testPassingTransportDependency()
410410
{
411411
// Mock transport
412-
$mockTransport = $this->getMock('\Phue\Transport\TransportInterface');
412+
$mockTransport = $this->createMock('\Phue\Transport\TransportInterface');
413413

414414
$this->client->setTransport($mockTransport);
415415

@@ -424,7 +424,7 @@ public function testPassingTransportDependency()
424424
public function testSendCommand()
425425
{
426426
// Mock command
427-
$mockCommand = $this->getMock('Phue\Command\CommandInterface',
427+
$mockCommand = $this->createMock('Phue\Command\CommandInterface',
428428
array(
429429
'send'
430430
));

tests/Phue/Test/Command/CreateGroupTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class CreateGroupTest extends \PHPUnit_Framework_TestCase
2424
public function setUp()
2525
{
2626
// Mock client
27-
$this->mockClient = $this->getMock('\Phue\Client',
27+
$this->mockClient = $this->createMock('\Phue\Client',
2828
array(
2929
'getUsername',
3030
'getTransport'
@@ -33,7 +33,7 @@ public function setUp()
3333
));
3434

3535
// Mock transport
36-
$this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
36+
$this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
3737
array(
3838
'sendRequest'
3939
));

tests/Phue/Test/Command/CreateSceneTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class CreateSceneTest extends \PHPUnit_Framework_TestCase
2424
public function setUp()
2525
{
2626
// Mock client
27-
$this->mockClient = $this->getMock('\Phue\Client',
27+
$this->mockClient = $this->createMock('\Phue\Client',
2828
array(
2929
'getUsername',
3030
'getTransport'
@@ -33,7 +33,7 @@ public function setUp()
3333
));
3434

3535
// Mock transport
36-
$this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
36+
$this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
3737
array(
3838
'sendRequest'
3939
));

tests/Phue/Test/Command/CreateScheduleTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function setUp()
2828
date_default_timezone_set('UTC');
2929

3030
// Mock client
31-
$this->mockClient = $this->getMock('\Phue\Client',
31+
$this->mockClient = $this->createMock('\Phue\Client',
3232
array(
3333
'getUsername',
3434
'getTransport'
@@ -37,7 +37,7 @@ public function setUp()
3737
));
3838

3939
// Mock transport
40-
$this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
40+
$this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
4141
array(
4242
'sendRequest'
4343
));
@@ -53,7 +53,7 @@ public function setUp()
5353
->will($this->returnValue($this->mockTransport));
5454

5555
// Mock actionable command
56-
$this->mockCommand = $this->getMock('\Phue\Command\ActionableInterface',
56+
$this->mockCommand = $this->createMock('\Phue\Command\ActionableInterface',
5757
array(
5858
'getActionableParams'
5959
));

tests/Phue/Test/Command/CreateUserTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class CreateUserTest extends \PHPUnit_Framework_TestCase
2424
public function setUp()
2525
{
2626
// Mock client
27-
$this->mockClient = $this->getMock('\Phue\Client',
27+
$this->mockClient = $this->createMock('\Phue\Client',
2828
array(
2929
'getUsername',
3030
'getTransport'
@@ -33,7 +33,7 @@ public function setUp()
3333
));
3434

3535
// Mock transport
36-
$this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
36+
$this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
3737
array(
3838
'sendRequest'
3939
));

tests/Phue/Test/Command/DeleteGroupTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class DeleteGroupTest extends \PHPUnit_Framework_TestCase
2424
public function setUp()
2525
{
2626
// Mock client
27-
$this->mockClient = $this->getMock('\Phue\Client',
27+
$this->mockClient = $this->createMock('\Phue\Client',
2828
array(
2929
'getUsername',
3030
'getTransport'
@@ -33,7 +33,7 @@ public function setUp()
3333
));
3434

3535
// Mock transport
36-
$this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
36+
$this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
3737
array(
3838
'sendRequest'
3939
));

tests/Phue/Test/Command/DeleteRuleTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class DeleteRuleTest extends \PHPUnit_Framework_TestCase
2424
public function setUp()
2525
{
2626
// Mock client
27-
$this->mockClient = $this->getMock('\Phue\Client',
27+
$this->mockClient = $this->createMock('\Phue\Client',
2828
array(
2929
'getUsername',
3030
'getTransport'
@@ -33,7 +33,7 @@ public function setUp()
3333
));
3434

3535
// Mock transport
36-
$this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
36+
$this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
3737
array(
3838
'sendRequest'
3939
));

tests/Phue/Test/Command/DeleteScheduleTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class DeleteScheduleTest extends \PHPUnit_Framework_TestCase
2424
public function setUp()
2525
{
2626
// Mock client
27-
$this->mockClient = $this->getMock('\Phue\Client',
27+
$this->mockClient = $this->createMock('\Phue\Client',
2828
array(
2929
'getUsername',
3030
'getTransport'
@@ -33,7 +33,7 @@ public function setUp()
3333
));
3434

3535
// Mock transport
36-
$this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
36+
$this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
3737
array(
3838
'sendRequest'
3939
));

tests/Phue/Test/Command/DeleteUserTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class DeleteUserTest extends \PHPUnit_Framework_TestCase
2424
public function setUp()
2525
{
2626
// Mock client
27-
$this->mockClient = $this->getMock('\Phue\Client',
27+
$this->mockClient = $this->createMock('\Phue\Client',
2828
array(
2929
'getUsername',
3030
'getTransport'
@@ -33,7 +33,7 @@ public function setUp()
3333
));
3434

3535
// Mock transport
36-
$this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
36+
$this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
3737
array(
3838
'sendRequest'
3939
));

tests/Phue/Test/Command/GetBridgeTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function setUp()
2626
$this->getBridge = new GetBridge();
2727

2828
// Mock client
29-
$this->mockClient = $this->getMock('\Phue\Client',
29+
$this->mockClient = $this->createMock('\Phue\Client',
3030
array(
3131
'getUsername',
3232
'getTransport'
@@ -35,7 +35,7 @@ public function setUp()
3535
));
3636

3737
// Mock transport
38-
$this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
38+
$this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
3939
array(
4040
'sendRequest'
4141
));

tests/Phue/Test/Command/GetGroupByIdTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class GetGroupByIdTest extends \PHPUnit_Framework_TestCase
2424
public function setUp()
2525
{
2626
// Mock client
27-
$this->mockClient = $this->getMock('\Phue\Client',
27+
$this->mockClient = $this->createMock('\Phue\Client',
2828
array(
2929
'getUsername',
3030
'getTransport'
@@ -33,7 +33,7 @@ public function setUp()
3333
));
3434

3535
// Mock transport
36-
$this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
36+
$this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
3737
array(
3838
'sendRequest'
3939
));

tests/Phue/Test/Command/GetGroupsTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function setUp()
2626
$this->getGroups = new GetGroups();
2727

2828
// Mock client
29-
$this->mockClient = $this->getMock('\Phue\Client',
29+
$this->mockClient = $this->createMock('\Phue\Client',
3030
array(
3131
'getUsername',
3232
'getTransport'
@@ -35,7 +35,7 @@ public function setUp()
3535
));
3636

3737
// Mock transport
38-
$this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
38+
$this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
3939
array(
4040
'sendRequest'
4141
));

tests/Phue/Test/Command/GetLightByIdTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class GetLightByIdTest extends \PHPUnit_Framework_TestCase
2424
public function setUp()
2525
{
2626
// Mock client
27-
$this->mockClient = $this->getMock('\Phue\Client',
27+
$this->mockClient = $this->createMock('\Phue\Client',
2828
array(
2929
'getUsername',
3030
'getTransport'
@@ -33,7 +33,7 @@ public function setUp()
3333
));
3434

3535
// Mock transport
36-
$this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
36+
$this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
3737
array(
3838
'sendRequest'
3939
));

tests/Phue/Test/Command/GetLightsTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function setUp()
2626
$this->getLights = new GetLights();
2727

2828
// Mock client
29-
$this->mockClient = $this->getMock('\Phue\Client',
29+
$this->mockClient = $this->createMock('\Phue\Client',
3030
array(
3131
'getUsername',
3232
'getTransport'
@@ -35,7 +35,7 @@ public function setUp()
3535
));
3636

3737
// Mock transport
38-
$this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
38+
$this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
3939
array(
4040
'sendRequest'
4141
));

tests/Phue/Test/Command/GetNewLightsTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function setUp()
2626
$this->getNewLights = new GetNewLights();
2727

2828
// Mock client
29-
$this->mockClient = $this->getMock('\Phue\Client',
29+
$this->mockClient = $this->createMock('\Phue\Client',
3030
array(
3131
'getUsername',
3232
'getTransport'
@@ -35,7 +35,7 @@ public function setUp()
3535
));
3636

3737
// Mock transport
38-
$this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
38+
$this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
3939
array(
4040
'sendRequest'
4141
));

tests/Phue/Test/Command/GetNewSensorsTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function setUp()
2626
$this->getNewSensors = new GetNewSensors();
2727

2828
// Mock client
29-
$this->mockClient = $this->getMock('\Phue\Client',
29+
$this->mockClient = $this->createMock('\Phue\Client',
3030
array(
3131
'getUsername',
3232
'getTransport'
@@ -35,7 +35,7 @@ public function setUp()
3535
));
3636

3737
// Mock transport
38-
$this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface',
38+
$this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface',
3939
array(
4040
'sendRequest'
4141
));

0 commit comments

Comments
 (0)