diff --git a/.travis.yml b/.travis.yml index 0d8f7ad..4cc3d15 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,9 @@ language: php php: - - 5.3 - - 5.4 - - 5.5 - 5.6 - 7.0 + - 7.1 - hhvm before_install: diff --git a/LICENSE b/LICENSE index d29b095..df7f6ea 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ Software License Agreement (The BSD 3-Clause License) -Copyright (c) 2012, Michael K. Squires +Copyright (c) 2017, Michael K. Squires All rights reserved. Redistribution and use in source and binary forms, with or without modification, diff --git a/README.md b/README.md index 78fd073..d67b4e1 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,11 @@ Interested in API docs? You can check out the [Philips API documentation](http:/ ## Requirements -* PHP 5.3+ +* PHP 5.6+ * cURL extension (optional) +For PHP 5.3 support, please use Phue v1.6.x. + ## Installation The Phue library is available in Packagist. You'll want to include ```sqmk/phue``` as a dependency in your project using composer. If you are not familiar with composer, check it out here: [Composer](http://getcomposer.org) diff --git a/composer.json b/composer.json index a27bf58..0cb9e28 100644 --- a/composer.json +++ b/composer.json @@ -18,12 +18,12 @@ } ], "require": { - "php": ">=5.3.0" + "php": ">=5.6.0" }, "require-dev": { - "mockery/mockery": "0.8.0", - "phpunit/PHPUnit": "3.7.25", - "squizlabs/php_codesniffer": "1.4.6" + "mockery/mockery": "1.0.0", + "phpunit/PHPUnit": "5.7.25", + "squizlabs/php_codesniffer": "3.1.1" }, "suggest": { "ext-curl": "Allows usage of cURL transport adapter" diff --git a/library/Phue/LightModel/Lct001Model.php b/library/Phue/LightModel/Lct001Model.php index db7546a..434e3e6 100644 --- a/library/Phue/LightModel/Lct001Model.php +++ b/library/Phue/LightModel/Lct001Model.php @@ -22,5 +22,5 @@ class Lct001Model extends AbstractLightModel /** * Model name */ - const MODEL_NAME = 'Hue bulb A19'; + const MODEL_NAME = 'Hue bulb A19 (gamut B)'; } diff --git a/library/Phue/LightModel/Lct007Model.php b/library/Phue/LightModel/Lct007Model.php index 637e973..743d2e8 100644 --- a/library/Phue/LightModel/Lct007Model.php +++ b/library/Phue/LightModel/Lct007Model.php @@ -22,5 +22,5 @@ class Lct007Model extends AbstractLightModel /** * Model name */ - const MODEL_NAME = 'Hue Bulb V2'; + const MODEL_NAME = 'Hue bulb A19 (gamut B)'; } diff --git a/library/Phue/LightModel/Lct010Model.php b/library/Phue/LightModel/Lct010Model.php new file mode 100644 index 0000000..2b45fa8 --- /dev/null +++ b/library/Phue/LightModel/Lct010Model.php @@ -0,0 +1,26 @@ + + * @copyright Copyright (c) 2012 Michael K. Squires + * @license http://github.com/sqmk/Phue/wiki/License + */ +namespace Phue\LightModel; + +/** + * Hue Bulb V3 + */ +class Lct010Model extends AbstractLightModel +{ + + /** + * Model id + */ + const MODEL_ID = 'LCT010'; + + /** + * Model name + */ + const MODEL_NAME = 'Hue bulb A19 (gamut C)'; +} diff --git a/library/Phue/LightModel/Lct011Model.php b/library/Phue/LightModel/Lct011Model.php new file mode 100644 index 0000000..cf81165 --- /dev/null +++ b/library/Phue/LightModel/Lct011Model.php @@ -0,0 +1,26 @@ + + * @copyright Copyright (c) 2012 Michael K. Squires + * @license http://github.com/sqmk/Phue/wiki/License + */ +namespace Phue\LightModel; + +/** + * Hue BR30 + */ +class Lct011Model extends AbstractLightModel +{ + + /** + * Model id + */ + const MODEL_ID = 'LCT011'; + + /** + * Model name + */ + const MODEL_NAME = 'Hue BR30'; +} diff --git a/library/Phue/LightModel/Lct014Model.php b/library/Phue/LightModel/Lct014Model.php new file mode 100644 index 0000000..db74dcd --- /dev/null +++ b/library/Phue/LightModel/Lct014Model.php @@ -0,0 +1,26 @@ + + * @copyright Copyright (c) 2012 Michael K. Squires + * @license http://github.com/sqmk/Phue/wiki/License + */ +namespace Phue\LightModel; + +/** + * Hue Bulb V3 + */ +class Lct014Model extends AbstractLightModel +{ + + /** + * Model id + */ + const MODEL_ID = 'LCT014'; + + /** + * Model name + */ + const MODEL_NAME = 'Hue bulb A19 (gamut C)'; +} diff --git a/library/Phue/LightModel/Llm010Model.php b/library/Phue/LightModel/Llm010Model.php new file mode 100644 index 0000000..910b09d --- /dev/null +++ b/library/Phue/LightModel/Llm010Model.php @@ -0,0 +1,26 @@ + + * @copyright Copyright (c) 2012 Michael K. Squires + * @license http://github.com/sqmk/Phue/wiki/License + */ +namespace Phue\LightModel; + +/** + * Color Light Module + */ +class Llm010Model extends AbstractLightModel +{ + + /** + * Model id + */ + const MODEL_ID = 'LLM010'; + + /** + * Model name + */ + const MODEL_NAME = 'Color Temperature Module'; +} diff --git a/library/Phue/LightModel/Llm011Model.php b/library/Phue/LightModel/Llm011Model.php new file mode 100644 index 0000000..2f64a14 --- /dev/null +++ b/library/Phue/LightModel/Llm011Model.php @@ -0,0 +1,26 @@ + + * @copyright Copyright (c) 2012 Michael K. Squires + * @license http://github.com/sqmk/Phue/wiki/License + */ +namespace Phue\LightModel; + +/** + * Color Light Module + */ +class Llm011Model extends AbstractLightModel +{ + + /** + * Model id + */ + const MODEL_ID = 'LLM011'; + + /** + * Model name + */ + const MODEL_NAME = 'Color Temperature Module'; +} diff --git a/library/Phue/LightModel/Llm012Model.php b/library/Phue/LightModel/Llm012Model.php new file mode 100644 index 0000000..f9484a5 --- /dev/null +++ b/library/Phue/LightModel/Llm012Model.php @@ -0,0 +1,26 @@ + + * @copyright Copyright (c) 2012 Michael K. Squires + * @license http://github.com/sqmk/Phue/wiki/License + */ +namespace Phue\LightModel; + +/** + * Color Light Module + */ +class Llm012Model extends AbstractLightModel +{ + + /** + * Model id + */ + const MODEL_ID = 'LLM012'; + + /** + * Model name + */ + const MODEL_NAME = 'Color Temperature Module'; +} diff --git a/library/Phue/LightModel/Lst002Model.php b/library/Phue/LightModel/Lst002Model.php new file mode 100644 index 0000000..6408bc3 --- /dev/null +++ b/library/Phue/LightModel/Lst002Model.php @@ -0,0 +1,31 @@ + + * @copyright Copyright (c) 2012 Michael K. Squires + * @license http://github.com/sqmk/Phue/wiki/License + */ +namespace Phue\LightModel; + +/** + * Hue LightStrips + */ +class Lst002Model extends AbstractLightModel +{ + + /** + * Model id + */ + const MODEL_ID = 'LST002'; + + /** + * Model name + */ + const MODEL_NAME = 'Hue LightStrips Plus'; + + /** + * Can retain state + */ + const CAN_RETAIN_STATE = true; +} diff --git a/library/Phue/LightModel/Ltw001Model.php b/library/Phue/LightModel/Ltw001Model.php new file mode 100644 index 0000000..e0c458e --- /dev/null +++ b/library/Phue/LightModel/Ltw001Model.php @@ -0,0 +1,26 @@ + + * @copyright Copyright (c) 2012 Michael K. Squires + * @license http://github.com/sqmk/Phue/wiki/License + */ +namespace Phue\LightModel; + +/** + * Hue A19 White Ambiance + */ +class Ltw001Model extends AbstractLightModel +{ + + /** + * Model id + */ + const MODEL_ID = 'LTW001'; + + /** + * Model name + */ + const MODEL_NAME = 'Hue A19 White Ambiance'; +} diff --git a/library/Phue/LightModel/Ltw004Model.php b/library/Phue/LightModel/Ltw004Model.php new file mode 100644 index 0000000..eefcd5a --- /dev/null +++ b/library/Phue/LightModel/Ltw004Model.php @@ -0,0 +1,26 @@ + + * @copyright Copyright (c) 2012 Michael K. Squires + * @license http://github.com/sqmk/Phue/wiki/License + */ +namespace Phue\LightModel; + +/** + * Hue A19 White Ambiance + */ +class Ltw004Model extends AbstractLightModel +{ + + /** + * Model id + */ + const MODEL_ID = 'LTW004'; + + /** + * Model name + */ + const MODEL_NAME = 'Hue A19 White Ambiance'; +} diff --git a/library/Phue/LightModel/Ltw013Model.php b/library/Phue/LightModel/Ltw013Model.php new file mode 100644 index 0000000..d760ff0 --- /dev/null +++ b/library/Phue/LightModel/Ltw013Model.php @@ -0,0 +1,26 @@ + + * @copyright Copyright (c) 2012 Michael K. Squires + * @license http://github.com/sqmk/Phue/wiki/License + */ +namespace Phue\LightModel; + +/** + * Hue GU-10 White Ambiance + */ +class Ltw013Model extends AbstractLightModel +{ + + /** + * Model id + */ + const MODEL_ID = 'LTW013'; + + /** + * Model name + */ + const MODEL_NAME = 'Hue GU-10 White Ambiance'; +} diff --git a/library/Phue/LightModel/Ltw014Model.php b/library/Phue/LightModel/Ltw014Model.php new file mode 100644 index 0000000..acc703f --- /dev/null +++ b/library/Phue/LightModel/Ltw014Model.php @@ -0,0 +1,26 @@ + + * @copyright Copyright (c) 2012 Michael K. Squires + * @license http://github.com/sqmk/Phue/wiki/License + */ +namespace Phue\LightModel; + +/** + * Hue GU-10 White Ambiance + */ +class Ltw014Model extends AbstractLightModel +{ + + /** + * Model id + */ + const MODEL_ID = 'LTW014'; + + /** + * Model name + */ + const MODEL_NAME = 'Hue GU-10 White Ambiance'; +} diff --git a/library/Phue/LightModel/Lwb007Model.php b/library/Phue/LightModel/Lwb007Model.php new file mode 100644 index 0000000..ebcb8e8 --- /dev/null +++ b/library/Phue/LightModel/Lwb007Model.php @@ -0,0 +1,26 @@ + + * @copyright Copyright (c) 2012 Michael K. Squires + * @license http://github.com/sqmk/Phue/wiki/License + */ +namespace Phue\LightModel; + +/** + * Hue A19 Lux + */ +class Lwb007Model extends AbstractLightModel +{ + + /** + * Model id + */ + const MODEL_ID = 'LWB007'; + + /** + * Model name + */ + const MODEL_NAME = 'Hue A19 Lux'; +} diff --git a/library/Phue/LightModel/Lwb010Model.php b/library/Phue/LightModel/Lwb010Model.php new file mode 100644 index 0000000..c666a26 --- /dev/null +++ b/library/Phue/LightModel/Lwb010Model.php @@ -0,0 +1,26 @@ + + * @copyright Copyright (c) 2012 Michael K. Squires + * @license http://github.com/sqmk/Phue/wiki/License + */ +namespace Phue\LightModel; + +/** + * Hue A19 Lux + */ +class Lwb010Model extends AbstractLightModel +{ + + /** + * Model id + */ + const MODEL_ID = 'LWB010'; + + /** + * Model name + */ + const MODEL_NAME = 'Hue A19 Lux'; +} diff --git a/library/Phue/LightModel/Lwb014Model.php b/library/Phue/LightModel/Lwb014Model.php new file mode 100644 index 0000000..d0d17ca --- /dev/null +++ b/library/Phue/LightModel/Lwb014Model.php @@ -0,0 +1,26 @@ + + * @copyright Copyright (c) 2012 Michael K. Squires + * @license http://github.com/sqmk/Phue/wiki/License + */ +namespace Phue\LightModel; + +/** + * Hue A19 Lux + */ +class Lwb014Model extends AbstractLightModel +{ + + /** + * Model id + */ + const MODEL_ID = 'LWB014'; + + /** + * Model name + */ + const MODEL_NAME = 'Hue A19 Lux'; +} diff --git a/library/Phue/Transport/Http.php b/library/Phue/Transport/Http.php index 2693cee..a27f0f7 100644 --- a/library/Phue/Transport/Http.php +++ b/library/Phue/Transport/Http.php @@ -227,7 +227,7 @@ protected function getJsonResponse($address, $method = self::METHOD_GET, \stdCla $contentType = $this->getAdapter()->getContentType(); // Throw connection exception if status code isn't 200 or wrong content type - if ($status != 200 || $contentType != 'application/json') { + if ($status != 200 || explode(';', $contentType)[0] != 'application/json') { throw new ConnectionException('Connection failure'); } diff --git a/library/Phue/Transport/TransportInterface.php b/library/Phue/Transport/TransportInterface.php index d0f14b3..f25dae6 100644 --- a/library/Phue/Transport/TransportInterface.php +++ b/library/Phue/Transport/TransportInterface.php @@ -37,14 +37,22 @@ interface TransportInterface /** * Send request * - * @param string $path - * API path - * @param string $method - * Request method - * @param \stdClass $data - * Body data + * @param string $address API path + * @param string $method Request method + * @param \stdClass $body Body data * * @return mixed Command result */ - public function sendRequest($path, $method = self::METHOD_GET, \stdClass $data = null); + public function sendRequest($address, $method = self::METHOD_GET, \stdClass $body = null); + + /** + * Send request, bypass body validation + * + * @param string $address API path + * @param string $method Request method + * @param \stdClass $body Body data + * + * @return mixed Command result + */ + public function sendRequestBypassBodyValidation($address, $method = self::METHOD_GET, \stdClass $body = null); } diff --git a/tests/Phue/Test/BridgeTest.php b/tests/Phue/Test/BridgeTest.php index 5c00ea5..4b11cae 100644 --- a/tests/Phue/Test/BridgeTest.php +++ b/tests/Phue/Test/BridgeTest.php @@ -23,7 +23,7 @@ class BridgeTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'sendCommand' ), array( diff --git a/tests/Phue/Test/ClientTest.php b/tests/Phue/Test/ClientTest.php index ce6f0aa..2e9d44f 100644 --- a/tests/Phue/Test/ClientTest.php +++ b/tests/Phue/Test/ClientTest.php @@ -62,7 +62,7 @@ public function testGetSetUsername() public function testGetBridge() { // Mock transport - $mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); @@ -87,7 +87,7 @@ public function testGetBridge() public function testGetUsers() { // Mock transport - $mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); @@ -127,7 +127,7 @@ public function testGetUsers() public function testGetLights() { // Mock transport - $mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); @@ -168,7 +168,7 @@ public function testGetLights() public function testGetGroups() { // Mock transport - $mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); @@ -209,7 +209,7 @@ public function testGetGroups() public function testGetSchedules() { // Mock transport - $mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); @@ -247,7 +247,7 @@ public function testGetSchedules() public function testGetScenes() { // Mock transport - $mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); @@ -290,7 +290,7 @@ public function testGetScenes() public function testGetSensors() { // Mock transport - $mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); @@ -327,7 +327,7 @@ public function testGetSensors() public function testGetRules() { // Mock transport - $mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); @@ -364,7 +364,7 @@ public function testGetRules() public function testGetTimezones() { // Mock transport - $mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest', 'sendRequestBypassBodyValidation' @@ -409,7 +409,7 @@ public function testInstantiateDefaultTransport() public function testPassingTransportDependency() { // Mock transport - $mockTransport = $this->getMock('\Phue\Transport\TransportInterface'); + $mockTransport = $this->createMock('\Phue\Transport\TransportInterface'); $this->client->setTransport($mockTransport); @@ -424,7 +424,7 @@ public function testPassingTransportDependency() public function testSendCommand() { // Mock command - $mockCommand = $this->getMock('Phue\Command\CommandInterface', + $mockCommand = $this->createMock('Phue\Command\CommandInterface', array( 'send' )); diff --git a/tests/Phue/Test/Command/CreateGroupTest.php b/tests/Phue/Test/Command/CreateGroupTest.php index 0707b20..41a49d6 100644 --- a/tests/Phue/Test/Command/CreateGroupTest.php +++ b/tests/Phue/Test/Command/CreateGroupTest.php @@ -24,7 +24,7 @@ class CreateGroupTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getUsername', 'getTransport' @@ -33,7 +33,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/Command/CreateSceneTest.php b/tests/Phue/Test/Command/CreateSceneTest.php index c03d115..09901cd 100644 --- a/tests/Phue/Test/Command/CreateSceneTest.php +++ b/tests/Phue/Test/Command/CreateSceneTest.php @@ -24,7 +24,7 @@ class CreateSceneTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getUsername', 'getTransport' @@ -33,7 +33,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/Command/CreateScheduleTest.php b/tests/Phue/Test/Command/CreateScheduleTest.php index e420b5c..9cdf321 100644 --- a/tests/Phue/Test/Command/CreateScheduleTest.php +++ b/tests/Phue/Test/Command/CreateScheduleTest.php @@ -28,7 +28,7 @@ public function setUp() date_default_timezone_set('UTC'); // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getUsername', 'getTransport' @@ -37,7 +37,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); @@ -53,7 +53,7 @@ public function setUp() ->will($this->returnValue($this->mockTransport)); // Mock actionable command - $this->mockCommand = $this->getMock('\Phue\Command\ActionableInterface', + $this->mockCommand = $this->createMock('\Phue\Command\ActionableInterface', array( 'getActionableParams' )); diff --git a/tests/Phue/Test/Command/CreateUserTest.php b/tests/Phue/Test/Command/CreateUserTest.php index 955ba34..137d2ad 100644 --- a/tests/Phue/Test/Command/CreateUserTest.php +++ b/tests/Phue/Test/Command/CreateUserTest.php @@ -24,7 +24,7 @@ class CreateUserTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getUsername', 'getTransport' @@ -33,7 +33,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/Command/DeleteGroupTest.php b/tests/Phue/Test/Command/DeleteGroupTest.php index b098324..5771392 100644 --- a/tests/Phue/Test/Command/DeleteGroupTest.php +++ b/tests/Phue/Test/Command/DeleteGroupTest.php @@ -24,7 +24,7 @@ class DeleteGroupTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getUsername', 'getTransport' @@ -33,7 +33,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/Command/DeleteRuleTest.php b/tests/Phue/Test/Command/DeleteRuleTest.php index b8c2f33..246cddc 100644 --- a/tests/Phue/Test/Command/DeleteRuleTest.php +++ b/tests/Phue/Test/Command/DeleteRuleTest.php @@ -24,7 +24,7 @@ class DeleteRuleTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getUsername', 'getTransport' @@ -33,7 +33,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/Command/DeleteScheduleTest.php b/tests/Phue/Test/Command/DeleteScheduleTest.php index 7d1ebf9..c39461d 100644 --- a/tests/Phue/Test/Command/DeleteScheduleTest.php +++ b/tests/Phue/Test/Command/DeleteScheduleTest.php @@ -24,7 +24,7 @@ class DeleteScheduleTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getUsername', 'getTransport' @@ -33,7 +33,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/Command/DeleteUserTest.php b/tests/Phue/Test/Command/DeleteUserTest.php index c091363..953abaa 100644 --- a/tests/Phue/Test/Command/DeleteUserTest.php +++ b/tests/Phue/Test/Command/DeleteUserTest.php @@ -24,7 +24,7 @@ class DeleteUserTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getUsername', 'getTransport' @@ -33,7 +33,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/Command/GetBridgeTest.php b/tests/Phue/Test/Command/GetBridgeTest.php index 74cabc8..b07325b 100644 --- a/tests/Phue/Test/Command/GetBridgeTest.php +++ b/tests/Phue/Test/Command/GetBridgeTest.php @@ -26,7 +26,7 @@ public function setUp() $this->getBridge = new GetBridge(); // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getUsername', 'getTransport' @@ -35,7 +35,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/Command/GetGroupByIdTest.php b/tests/Phue/Test/Command/GetGroupByIdTest.php index 54be348..9750907 100644 --- a/tests/Phue/Test/Command/GetGroupByIdTest.php +++ b/tests/Phue/Test/Command/GetGroupByIdTest.php @@ -24,7 +24,7 @@ class GetGroupByIdTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getUsername', 'getTransport' @@ -33,7 +33,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/Command/GetGroupsTest.php b/tests/Phue/Test/Command/GetGroupsTest.php index beab41e..b45721f 100644 --- a/tests/Phue/Test/Command/GetGroupsTest.php +++ b/tests/Phue/Test/Command/GetGroupsTest.php @@ -26,7 +26,7 @@ public function setUp() $this->getGroups = new GetGroups(); // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getUsername', 'getTransport' @@ -35,7 +35,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/Command/GetLightByIdTest.php b/tests/Phue/Test/Command/GetLightByIdTest.php index 7ded9ef..1019a19 100644 --- a/tests/Phue/Test/Command/GetLightByIdTest.php +++ b/tests/Phue/Test/Command/GetLightByIdTest.php @@ -24,7 +24,7 @@ class GetLightByIdTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getUsername', 'getTransport' @@ -33,7 +33,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/Command/GetLightsTest.php b/tests/Phue/Test/Command/GetLightsTest.php index 2b08162..0e37c8e 100644 --- a/tests/Phue/Test/Command/GetLightsTest.php +++ b/tests/Phue/Test/Command/GetLightsTest.php @@ -26,7 +26,7 @@ public function setUp() $this->getLights = new GetLights(); // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getUsername', 'getTransport' @@ -35,7 +35,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/Command/GetNewLightsTest.php b/tests/Phue/Test/Command/GetNewLightsTest.php index cfe3d52..173b8dd 100644 --- a/tests/Phue/Test/Command/GetNewLightsTest.php +++ b/tests/Phue/Test/Command/GetNewLightsTest.php @@ -26,7 +26,7 @@ public function setUp() $this->getNewLights = new GetNewLights(); // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getUsername', 'getTransport' @@ -35,7 +35,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/Command/GetNewSensorsTest.php b/tests/Phue/Test/Command/GetNewSensorsTest.php index 42402de..2749089 100644 --- a/tests/Phue/Test/Command/GetNewSensorsTest.php +++ b/tests/Phue/Test/Command/GetNewSensorsTest.php @@ -26,7 +26,7 @@ public function setUp() $this->getNewSensors = new GetNewSensors(); // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getUsername', 'getTransport' @@ -35,7 +35,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/Command/GetRulesTest.php b/tests/Phue/Test/Command/GetRulesTest.php index 568f473..518c852 100644 --- a/tests/Phue/Test/Command/GetRulesTest.php +++ b/tests/Phue/Test/Command/GetRulesTest.php @@ -26,7 +26,7 @@ public function setUp() $this->getRules = new GetRules(); // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getUsername', 'getTransport' @@ -35,7 +35,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/Command/GetScenesTest.php b/tests/Phue/Test/Command/GetScenesTest.php index e86ad6d..53c5f9f 100644 --- a/tests/Phue/Test/Command/GetScenesTest.php +++ b/tests/Phue/Test/Command/GetScenesTest.php @@ -26,7 +26,7 @@ public function setUp() $this->getScenes = new GetScenes(); // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getUsername', 'getTransport' @@ -35,7 +35,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/Command/GetScheduleByIdTest.php b/tests/Phue/Test/Command/GetScheduleByIdTest.php index 5bac74d..f92c128 100644 --- a/tests/Phue/Test/Command/GetScheduleByIdTest.php +++ b/tests/Phue/Test/Command/GetScheduleByIdTest.php @@ -24,7 +24,7 @@ class GetScheduleByIdTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getTransport' ), array( @@ -32,7 +32,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/Command/GetSchedulesTest.php b/tests/Phue/Test/Command/GetSchedulesTest.php index a282b18..492a5f9 100644 --- a/tests/Phue/Test/Command/GetSchedulesTest.php +++ b/tests/Phue/Test/Command/GetSchedulesTest.php @@ -26,7 +26,7 @@ public function setUp() $this->getSchedules = new GetSchedules(); // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getUsername', 'getTransport' @@ -35,7 +35,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/Command/GetSensorsTest.php b/tests/Phue/Test/Command/GetSensorsTest.php index 8d55754..32ff02e 100644 --- a/tests/Phue/Test/Command/GetSensorsTest.php +++ b/tests/Phue/Test/Command/GetSensorsTest.php @@ -26,7 +26,7 @@ public function setUp() $this->getSensors = new GetSensors(); // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getUsername', 'getTransport' @@ -35,7 +35,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/Command/GetTimezonesTest.php b/tests/Phue/Test/Command/GetTimezonesTest.php index 36800ea..e95a4e7 100644 --- a/tests/Phue/Test/Command/GetTimezonesTest.php +++ b/tests/Phue/Test/Command/GetTimezonesTest.php @@ -26,7 +26,7 @@ public function setUp() $this->getTimezones = new GetTimezones(); // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getUsername', 'getTransport' @@ -35,7 +35,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest', 'sendRequestBypassBodyValidation' diff --git a/tests/Phue/Test/Command/GetUsersTest.php b/tests/Phue/Test/Command/GetUsersTest.php index 030b4d2..b398133 100644 --- a/tests/Phue/Test/Command/GetUsersTest.php +++ b/tests/Phue/Test/Command/GetUsersTest.php @@ -26,7 +26,7 @@ public function setUp() $this->getUsers = new GetUsers(); // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getUsername', 'getTransport' @@ -35,7 +35,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/Command/IsAuthorizedTest.php b/tests/Phue/Test/Command/IsAuthorizedTest.php index 9e649b3..659b505 100644 --- a/tests/Phue/Test/Command/IsAuthorizedTest.php +++ b/tests/Phue/Test/Command/IsAuthorizedTest.php @@ -25,7 +25,7 @@ class IsAuthorizedTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getTransport' ), array( @@ -33,7 +33,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); @@ -76,9 +76,9 @@ public function testIsNotAuthorized() $this->mockTransport->expects($this->once()) ->method('sendRequest') ->with($this->equalTo("/api/{$this->mockClient->getUsername()}")) - ->will( - $this->throwException( - $this->getMock('\Phue\Transport\Exception\UnauthorizedUserException'))); + ->will($this->throwException( + $this->createMock('\Phue\Transport\Exception\UnauthorizedUserException') + )); $auth = new IsAuthorized(); $this->assertFalse($auth->send($this->mockClient)); diff --git a/tests/Phue/Test/Command/PingTest.php b/tests/Phue/Test/Command/PingTest.php index f75e86f..9155f6b 100644 --- a/tests/Phue/Test/Command/PingTest.php +++ b/tests/Phue/Test/Command/PingTest.php @@ -24,7 +24,7 @@ class PingTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getTransport' ), array( @@ -32,7 +32,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/Command/SetBridgeConfigTest.php b/tests/Phue/Test/Command/SetBridgeConfigTest.php index c8b0f36..e64b836 100644 --- a/tests/Phue/Test/Command/SetBridgeConfigTest.php +++ b/tests/Phue/Test/Command/SetBridgeConfigTest.php @@ -24,7 +24,7 @@ class SetBridgeConfigTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getTransport' ), array( @@ -32,7 +32,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/Command/SetGroupAttributesTest.php b/tests/Phue/Test/Command/SetGroupAttributesTest.php index 8218fea..bbeb7c9 100644 --- a/tests/Phue/Test/Command/SetGroupAttributesTest.php +++ b/tests/Phue/Test/Command/SetGroupAttributesTest.php @@ -24,7 +24,7 @@ class SetGroupAttributesTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getTransport' ), array( @@ -32,13 +32,13 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); // Mock group - $this->mockGroup = $this->getMock('\Phue\Group', null, + $this->mockGroup = $this->createMock('\Phue\Group', null, array( 2, new \stdClass(), diff --git a/tests/Phue/Test/Command/SetGroupStateTest.php b/tests/Phue/Test/Command/SetGroupStateTest.php index 14cae95..80e8ca6 100644 --- a/tests/Phue/Test/Command/SetGroupStateTest.php +++ b/tests/Phue/Test/Command/SetGroupStateTest.php @@ -24,7 +24,7 @@ class SetGroupStateTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getTransport' ), array( @@ -32,13 +32,13 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); // Mock group - $this->mockGroup = $this->getMock('\Phue\Group', null, + $this->mockGroup = $this->createMock('\Phue\Group', null, array( 2, new \stdClass(), diff --git a/tests/Phue/Test/Command/SetLightNameTest.php b/tests/Phue/Test/Command/SetLightNameTest.php index 09c4631..440a9b8 100644 --- a/tests/Phue/Test/Command/SetLightNameTest.php +++ b/tests/Phue/Test/Command/SetLightNameTest.php @@ -25,7 +25,7 @@ class SetLightNameTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getTransport' ), array( @@ -33,13 +33,13 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); // Mock light - $this->mockLight = $this->getMock('\Phue\Light', null, + $this->mockLight = $this->createMock('\Phue\Light', null, array( 3, new \stdClass(), diff --git a/tests/Phue/Test/Command/SetLightStateTest.php b/tests/Phue/Test/Command/SetLightStateTest.php index 3d00ccd..20672b0 100644 --- a/tests/Phue/Test/Command/SetLightStateTest.php +++ b/tests/Phue/Test/Command/SetLightStateTest.php @@ -25,7 +25,7 @@ class SetLightStateTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getTransport' ), array( @@ -33,13 +33,13 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); // Mock light - $this->mockLight = $this->getMock('\Phue\Light', null, + $this->mockLight = $this->createMock('\Phue\Light', null, array( 3, new \stdClass(), diff --git a/tests/Phue/Test/Command/SetSceneLightStateTest.php b/tests/Phue/Test/Command/SetSceneLightStateTest.php index f4febac..c3fed24 100644 --- a/tests/Phue/Test/Command/SetSceneLightStateTest.php +++ b/tests/Phue/Test/Command/SetSceneLightStateTest.php @@ -24,7 +24,7 @@ class SetSceneLightStateTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getTransport' ), array( @@ -32,13 +32,13 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); // Mock scene - $this->mockScene = $this->getMock('\Phue\Scene', null, + $this->mockScene = $this->createMock('\Phue\Scene', null, array( 'phue-test', new \stdClass(), @@ -46,7 +46,7 @@ public function setUp() )); // Mock light - $this->mockLight = $this->getMock('\Phue\Light', null, + $this->mockLight = $this->createMock('\Phue\Light', null, array( 3, new \stdClass(), diff --git a/tests/Phue/Test/Command/SetScheduleAttributesTest.php b/tests/Phue/Test/Command/SetScheduleAttributesTest.php index 44fcd44..8852c8a 100644 --- a/tests/Phue/Test/Command/SetScheduleAttributesTest.php +++ b/tests/Phue/Test/Command/SetScheduleAttributesTest.php @@ -24,7 +24,7 @@ class SetScheduleAttributesTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getTransport' ), array( @@ -32,13 +32,13 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); // Mock schedule - $this->mockSchedule = $this->getMock('\Phue\Schedule', null, + $this->mockSchedule = $this->createMock('\Phue\Schedule', null, array( 12, new \stdClass(), @@ -56,7 +56,7 @@ public function setUp() ->will($this->returnValue($this->mockTransport)); // Mock actionable command - $this->mockCommand = $this->getMock('\Phue\Command\ActionableInterface', + $this->mockCommand = $this->createMock('\Phue\Command\ActionableInterface', array( 'getActionableParams' )); diff --git a/tests/Phue/Test/Command/StartLightScanTest.php b/tests/Phue/Test/Command/StartLightScanTest.php index b916b0c..ee1c9a0 100644 --- a/tests/Phue/Test/Command/StartLightScanTest.php +++ b/tests/Phue/Test/Command/StartLightScanTest.php @@ -24,7 +24,7 @@ class StartLightScanTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getTransport' ), array( @@ -32,7 +32,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/Command/StartSensorScanTest.php b/tests/Phue/Test/Command/StartSensorScanTest.php index 476c20f..60d911a 100644 --- a/tests/Phue/Test/Command/StartSensorScanTest.php +++ b/tests/Phue/Test/Command/StartSensorScanTest.php @@ -24,7 +24,7 @@ class StartSensorScanTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'getTransport' ), array( @@ -32,7 +32,7 @@ public function setUp() )); // Mock transport - $this->mockTransport = $this->getMock('\Phue\Transport\TransportInterface', + $this->mockTransport = $this->createMock('\Phue\Transport\TransportInterface', array( 'sendRequest' )); diff --git a/tests/Phue/Test/GroupTest.php b/tests/Phue/Test/GroupTest.php index a7057ef..8a5a467 100644 --- a/tests/Phue/Test/GroupTest.php +++ b/tests/Phue/Test/GroupTest.php @@ -24,9 +24,7 @@ class GroupTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', - // ['sendCommand'], - // ['127.0.0.1'] + $this->mockClient = $this->createMock('\Phue\Client', array( 'sendCommand' ), array( @@ -34,21 +32,6 @@ public function setUp() )); // Build stub attributes - // $this->attributes = (object) [ - // 'name' => 'Dummy group', - // 'action' => (object) [ - // 'on' => false, - // 'bri' => '66', - // 'hue' => '60123', - // 'sat' => 213, - // 'xy' => [0.5, 0.4], - // 'ct' => 300, - // 'colormode' => 'hs', - // 'effect' => 'none', - // ], - // 'lights' => [2, 3, 5], - // 'type' => 'LightGroup', - // ]; $this->attributes = (object) array( 'name' => 'Dummy group', 'action' => (object) array( diff --git a/tests/Phue/Test/LightTest.php b/tests/Phue/Test/LightTest.php index c6eb8d7..9444f46 100644 --- a/tests/Phue/Test/LightTest.php +++ b/tests/Phue/Test/LightTest.php @@ -23,7 +23,7 @@ class LightTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', // ['sendCommand'], // ['127.0.0.1'] array( diff --git a/tests/Phue/Test/PortalTest.php b/tests/Phue/Test/PortalTest.php index 92da934..368b838 100644 --- a/tests/Phue/Test/PortalTest.php +++ b/tests/Phue/Test/PortalTest.php @@ -25,7 +25,7 @@ class PortalTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'sendCommand' ), array( diff --git a/tests/Phue/Test/RuleTest.php b/tests/Phue/Test/RuleTest.php index 90d9c2b..e8b7ed8 100644 --- a/tests/Phue/Test/RuleTest.php +++ b/tests/Phue/Test/RuleTest.php @@ -25,7 +25,7 @@ class RuleTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'sendCommand' ), array( diff --git a/tests/Phue/Test/SceneTest.php b/tests/Phue/Test/SceneTest.php index c9634a3..4546eb4 100644 --- a/tests/Phue/Test/SceneTest.php +++ b/tests/Phue/Test/SceneTest.php @@ -25,7 +25,7 @@ class SceneTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'sendCommand' ), array( diff --git a/tests/Phue/Test/ScheduleTest.php b/tests/Phue/Test/ScheduleTest.php index c3a482a..bca7e7c 100644 --- a/tests/Phue/Test/ScheduleTest.php +++ b/tests/Phue/Test/ScheduleTest.php @@ -26,7 +26,7 @@ public function setUp() date_default_timezone_set('UTC'); // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'sendCommand' ), array( @@ -187,7 +187,7 @@ public function testSetCommand() ->will($this->returnValue($this->schedule)); // Mock actionable command - $mockCommand = $this->getMock('\Phue\Command\ActionableInterface', + $mockCommand = $this->createMock('\Phue\Command\ActionableInterface', array( 'getActionableParams' )); diff --git a/tests/Phue/Test/SensorTest.php b/tests/Phue/Test/SensorTest.php index 5916bdc..3a81047 100644 --- a/tests/Phue/Test/SensorTest.php +++ b/tests/Phue/Test/SensorTest.php @@ -25,7 +25,7 @@ class SensorTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'sendCommand' ), array( diff --git a/tests/Phue/Test/SoftwareUpdateTest.php b/tests/Phue/Test/SoftwareUpdateTest.php index ebaf827..f625268 100644 --- a/tests/Phue/Test/SoftwareUpdateTest.php +++ b/tests/Phue/Test/SoftwareUpdateTest.php @@ -25,7 +25,7 @@ class SoftwareUpdateTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'sendCommand' ), array( diff --git a/tests/Phue/Test/Transport/HttpTest.php b/tests/Phue/Test/Transport/HttpTest.php index 749fcc4..e77c6d3 100644 --- a/tests/Phue/Test/Transport/HttpTest.php +++ b/tests/Phue/Test/Transport/HttpTest.php @@ -22,7 +22,7 @@ class HttpTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', // ['getTransport'], // ['127.0.0.1'] array( @@ -32,7 +32,7 @@ public function setUp() )); // Mock transport adapter - $this->mockAdapter = $this->getMock( + $this->mockAdapter = $this->createMock( '\Phue\Transport\Adapter\AdapterInterface'); // Set transport diff --git a/tests/Phue/Test/UserTest.php b/tests/Phue/Test/UserTest.php index 03f999b..a3f242c 100644 --- a/tests/Phue/Test/UserTest.php +++ b/tests/Phue/Test/UserTest.php @@ -23,7 +23,7 @@ class UserTest extends \PHPUnit_Framework_TestCase public function setUp() { // Mock client - $this->mockClient = $this->getMock('\Phue\Client', + $this->mockClient = $this->createMock('\Phue\Client', array( 'sendCommand' ), array(