Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

GitHub #9 - Change indentation on chaining.

  • Loading branch information...
commit 090cfca3d2e8a604e07ad4eb482ccc60bfdcd61e 1 parent 29e0b4d
@sqmk authored
Showing with 291 additions and 293 deletions.
  1. +3 −3 tests/PhueTest/BridgeTest.php
  2. +14 −14 tests/PhueTest/ClientTest.php
  3. +16 −16 tests/PhueTest/Command/CreateGroupTest.php
  4. +30 −32 tests/PhueTest/Command/CreateScheduleTest.php
  5. +11 −11 tests/PhueTest/Command/CreateUserTest.php
  6. +9 −9 tests/PhueTest/Command/DeleteGroupTest.php
  7. +9 −9 tests/PhueTest/Command/DeleteScheduleTest.php
  8. +9 −9 tests/PhueTest/Command/DeleteUserTest.php
  9. +7 −7 tests/PhueTest/Command/GetBridgeTest.php
  10. +7 −7 tests/PhueTest/Command/GetGroupByIdTest.php
  11. +10 −10 tests/PhueTest/Command/GetGroupsTest.php
  12. +7 −7 tests/PhueTest/Command/GetLightByIdTest.php
  13. +10 −10 tests/PhueTest/Command/GetLightsTest.php
  14. +7 −7 tests/PhueTest/Command/GetNewLightsTest.php
  15. +7 −7 tests/PhueTest/Command/GetScheduleByIdTest.php
  16. +10 −10 tests/PhueTest/Command/GetSchedulesTest.php
  17. +10 −10 tests/PhueTest/Command/GetUsersTest.php
  18. +13 −13 tests/PhueTest/Command/IsAuthorizedTest.php
  19. +4 −4 tests/PhueTest/Command/PingTest.php
  20. +12 −12 tests/PhueTest/Command/SetBridgeConfigTest.php
  21. +12 −12 tests/PhueTest/Command/SetGroupAttributesTest.php
  22. +13 −13 tests/PhueTest/Command/SetGroupStateTest.php
  23. +12 −12 tests/PhueTest/Command/SetLightNameTest.php
  24. +12 −12 tests/PhueTest/Command/SetLightStateTest.php
  25. +4 −4 tests/PhueTest/Command/SetScheduleAttributesTest.php
  26. +10 −10 tests/PhueTest/Command/StartLightScanTest.php
  27. +10 −10 tests/PhueTest/GroupTest.php
  28. +5 −5 tests/PhueTest/LightTest.php
  29. +6 −6 tests/PhueTest/Transport/HttpTest.php
  30. +2 −2 tests/PhueTest/UserTest.php
View
6 tests/PhueTest/BridgeTest.php
@@ -79,9 +79,9 @@ public function testSetName()
{
// Expect client's sendCommand usage
$this->mockClient->expects($this->once())
- ->method('sendCommand')
- ->with($this->isInstanceOf('\Phue\Command\SetBridgeConfig'))
- ->will($this->returnValue($this->bridge));
+ ->method('sendCommand')
+ ->with($this->isInstanceOf('\Phue\Command\SetBridgeConfig'))
+ ->will($this->returnValue($this->bridge));
// Ensure setName returns self
$this->assertEquals(
View
28 tests/PhueTest/ClientTest.php
@@ -23,7 +23,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase
*/
public function setUp()
{
- $this->client = new Client('127.0.0.1');
+ $this->client = new Client('127.0.0.1');
}
/**
@@ -72,8 +72,8 @@ public function testGetBridge()
// Stub transports sendRequest method
$mockTransport->expects($this->once())
- ->method('sendRequest')
- ->will($this->returnValue(new \stdClass));
+ ->method('sendRequest')
+ ->will($this->returnValue(new \stdClass));
// Set transport
$this->client->setTransport($mockTransport);
@@ -109,8 +109,8 @@ public function testGetUsers()
// Stub transports sendRequest method
$mockTransport->expects($this->once())
- ->method('sendRequest')
- ->will($this->returnValue($mockResults));
+ ->method('sendRequest')
+ ->will($this->returnValue($mockResults));
// Set transport
$this->client->setTransport($mockTransport);
@@ -151,8 +151,8 @@ public function testGetLights()
// Stub transports sendRequest method
$mockTransport->expects($this->once())
- ->method('sendRequest')
- ->will($this->returnValue($mockResults));
+ ->method('sendRequest')
+ ->will($this->returnValue($mockResults));
// Set transport
$this->client->setTransport($mockTransport);
@@ -193,8 +193,8 @@ public function testGetGroups()
// Stub transports sendRequest method
$mockTransport->expects($this->once())
- ->method('sendRequest')
- ->will($this->returnValue($mockResults));
+ ->method('sendRequest')
+ ->will($this->returnValue($mockResults));
// Set transport
$this->client->setTransport($mockTransport);
@@ -236,8 +236,8 @@ public function testGetSchedules()
// Stub transports sendRequest method
$mockTransport->expects($this->once())
- ->method('sendRequest')
- ->will($this->returnValue($mockResults));
+ ->method('sendRequest')
+ ->will($this->returnValue($mockResults));
// Set transport
$this->client->setTransport($mockTransport);
@@ -302,9 +302,9 @@ public function testSendCommand()
// Stub command's send method
$mockCommand->expects($this->once())
- ->method('send')
- ->with($this->equalTo($this->client))
- ->will($this->returnValue('sample response'));
+ ->method('send')
+ ->with($this->equalTo($this->client))
+ ->will($this->returnValue('sample response'));
$this->assertEquals(
$this->client->sendCommand($mockCommand),
View
32 tests/PhueTest/Command/CreateGroupTest.php
@@ -38,13 +38,13 @@ public function setUp()
// Stub client's getUsername method
$this->mockClient->expects($this->any())
- ->method('getUsername')
- ->will($this->returnValue('abcdefabcdef01234567890123456789'));
+ ->method('getUsername')
+ ->will($this->returnValue('abcdefabcdef01234567890123456789'));
// Stub client's getTransport method
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
}
/**
@@ -101,18 +101,18 @@ public function testSend()
// Stub transport's sendRequest usage
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with(
- $this->equalTo("{$this->mockClient->getUsername()}/groups"),
- $this->equalTo(TransportInterface::METHOD_POST),
- $this->equalTo(
- (object) [
- 'name' => 'Dummy',
- 'lights' => [2, 3]
- ]
- )
- )
- ->will($this->returnValue((object)['id' => '/path/5']));
+ ->method('sendRequest')
+ ->with(
+ $this->equalTo("{$this->mockClient->getUsername()}/groups"),
+ $this->equalTo(TransportInterface::METHOD_POST),
+ $this->equalTo(
+ (object) [
+ 'name' => 'Dummy',
+ 'lights' => [2, 3]
+ ]
+ )
+ )
+ ->will($this->returnValue((object)['id' => '/path/5']));
// Send command and get response
$groupId = $command->send($this->mockClient);
View
62 tests/PhueTest/Command/CreateScheduleTest.php
@@ -41,13 +41,13 @@ public function setUp()
// Stub client's getUsername method
$this->mockClient->expects($this->any())
- ->method('getUsername')
- ->will($this->returnValue('abcdefabcdef01234567890123456789'));
+ ->method('getUsername')
+ ->will($this->returnValue('abcdefabcdef01234567890123456789'));
// Stub client's getTransport method
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
// Mock schedulable command
$this->mockCommand = $this->getMock(
@@ -57,16 +57,14 @@ public function setUp()
// Stub command's getSchedulableParams method
$this->mockCommand->expects($this->any())
- ->method('getSchedulableParams')
- ->will(
- $this->returnValue(
- [
- 'address' => '/api/endpoint',
- 'method' => 'POST',
- 'body' => 'Dummy'
- ]
- )
- );
+ ->method('getSchedulableParams')
+ ->will(
+ $this->returnValue([
+ 'address' => '/api/endpoint',
+ 'method' => 'POST',
+ 'body' => 'Dummy'
+ ])
+ );
}
/**
@@ -164,24 +162,24 @@ public function testSend()
// Stub transport's sendRequest usage
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with(
- $this->equalTo("{$this->mockClient->getUsername()}/schedules"),
- $this->equalTo(TransportInterface::METHOD_POST),
- $this->equalTo(
- (object) [
- 'name' => 'Dummy!',
- 'description' => 'Description!',
- 'time' => '2012-12-30T10:11:12',
- 'command' => [
- 'method' => TransportInterface::METHOD_POST,
- 'address' => "/api/endpoint",
- 'body' => "Dummy"
- ]
- ]
- )
- )
- ->will($this->returnValue(4));
+ ->method('sendRequest')
+ ->with(
+ $this->equalTo("{$this->mockClient->getUsername()}/schedules"),
+ $this->equalTo(TransportInterface::METHOD_POST),
+ $this->equalTo(
+ (object) [
+ 'name' => 'Dummy!',
+ 'description' => 'Description!',
+ 'time' => '2012-12-30T10:11:12',
+ 'command' => [
+ 'method' => TransportInterface::METHOD_POST,
+ 'address' => "/api/endpoint",
+ 'body' => "Dummy"
+ ]
+ ]
+ )
+ )
+ ->will($this->returnValue(4));
// Send command and get response
$scheduleId = $command->send($this->mockClient);
View
22 tests/PhueTest/Command/CreateUserTest.php
@@ -38,13 +38,13 @@ public function setUp()
// Stub client's getUsername method
$this->mockClient->expects($this->any())
- ->method('getUsername')
- ->will($this->returnValue('abcdefabcdef01234567890123456789'));
+ ->method('getUsername')
+ ->will($this->returnValue('abcdefabcdef01234567890123456789'));
// Stub client's getTransport method
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
}
/**
@@ -86,13 +86,13 @@ public function testSend()
// Stub transport's sendRequest method
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with(
- $this->equalTo(''),
- $this->equalTo('POST'),
- $this->anything()
- )
- ->will($this->returnValue('success!'));
+ ->method('sendRequest')
+ ->with(
+ $this->equalTo(''),
+ $this->equalTo('POST'),
+ $this->anything()
+ )
+ ->will($this->returnValue('success!'));
$this->assertEquals(
(new CreateUser('testuser0123', 'phpunit'))->send($this->mockClient),
View
18 tests/PhueTest/Command/DeleteGroupTest.php
@@ -38,13 +38,13 @@ public function setUp()
// Stub client's getUsername method
$this->mockClient->expects($this->any())
- ->method('getUsername')
- ->will($this->returnValue('abcdefabcdef01234567890123456789'));
+ ->method('getUsername')
+ ->will($this->returnValue('abcdefabcdef01234567890123456789'));
// Stub client's getTransport method
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
}
/**
@@ -59,11 +59,11 @@ public function testSend()
// Stub transport's sendRequest usage
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with(
- $this->equalTo("{$this->mockClient->getUsername()}/groups/5"),
- $this->equalTo(TransportInterface::METHOD_DELETE)
- );
+ ->method('sendRequest')
+ ->with(
+ $this->equalTo("{$this->mockClient->getUsername()}/groups/5"),
+ $this->equalTo(TransportInterface::METHOD_DELETE)
+ );
// Send command
$command->send($this->mockClient);
View
18 tests/PhueTest/Command/DeleteScheduleTest.php
@@ -38,13 +38,13 @@ public function setUp()
// Stub client's getUsername method
$this->mockClient->expects($this->any())
- ->method('getUsername')
- ->will($this->returnValue('abcdefabcdef01234567890123456789'));
+ ->method('getUsername')
+ ->will($this->returnValue('abcdefabcdef01234567890123456789'));
// Stub client's getTransport method
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
}
/**
@@ -59,11 +59,11 @@ public function testSend()
// Stub transport's sendRequest usage
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with(
- $this->equalTo("{$this->mockClient->getUsername()}/schedules/4"),
- $this->equalTo(TransportInterface::METHOD_DELETE)
- );
+ ->method('sendRequest')
+ ->with(
+ $this->equalTo("{$this->mockClient->getUsername()}/schedules/4"),
+ $this->equalTo(TransportInterface::METHOD_DELETE)
+ );
// Send command
$command->send($this->mockClient);
View
18 tests/PhueTest/Command/DeleteUserTest.php
@@ -38,13 +38,13 @@ public function setUp()
// Stub client's getUsername method
$this->mockClient->expects($this->any())
- ->method('getUsername')
- ->will($this->returnValue('abcdefabcdef01234567890123456789'));
+ ->method('getUsername')
+ ->will($this->returnValue('abcdefabcdef01234567890123456789'));
// Stub client's getTransport method
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
}
/**
@@ -59,11 +59,11 @@ public function testSend()
// Stub transport's sendRequest usage
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with(
- $this->equalTo("{$this->mockClient->getUsername()}/config/whitelist/atestusername"),
- $this->equalTo(TransportInterface::METHOD_DELETE)
- );
+ ->method('sendRequest')
+ ->with(
+ $this->equalTo("{$this->mockClient->getUsername()}/config/whitelist/atestusername"),
+ $this->equalTo(TransportInterface::METHOD_DELETE)
+ );
// Send command
$command->send($this->mockClient);
View
14 tests/PhueTest/Command/GetBridgeTest.php
@@ -40,13 +40,13 @@ public function setUp()
// Stub client's getUsername method
$this->mockClient->expects($this->any())
- ->method('getUsername')
- ->will($this->returnValue('abcdefabcdef01234567890123456789'));
+ ->method('getUsername')
+ ->will($this->returnValue('abcdefabcdef01234567890123456789'));
// Stub client's getTransport method
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
}
/**
@@ -61,9 +61,9 @@ public function testGetBridge()
// Stub transport's sendRequest usage
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with($this->equalTo("{$this->mockClient->getUsername()}/config"))
- ->will($this->returnValue($mockTransportResults));
+ ->method('sendRequest')
+ ->with($this->equalTo("{$this->mockClient->getUsername()}/config"))
+ ->will($this->returnValue($mockTransportResults));
// Send command and get response
$response = $this->getBridge->send($this->mockClient);
View
14 tests/PhueTest/Command/GetGroupByIdTest.php
@@ -38,13 +38,13 @@ public function setUp()
// Stub client's getUsername method
$this->mockClient->expects($this->any())
- ->method('getUsername')
- ->will($this->returnValue('abcdefabcdef01234567890123456789'));
+ ->method('getUsername')
+ ->will($this->returnValue('abcdefabcdef01234567890123456789'));
// Stub client getTransport usage
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
}
/**
@@ -57,9 +57,9 @@ public function testSend()
{
// Stub transport's sendRequest usage
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with("{$this->mockClient->getUsername()}/groups/5")
- ->will($this->returnValue(new \stdClass));
+ ->method('sendRequest')
+ ->with("{$this->mockClient->getUsername()}/groups/5")
+ ->will($this->returnValue(new \stdClass));
// Get group
$group = (new GetGroupById(5))->send($this->mockClient);
View
20 tests/PhueTest/Command/GetGroupsTest.php
@@ -40,13 +40,13 @@ public function setUp()
// Stub client's getUsername method
$this->mockClient->expects($this->any())
- ->method('getUsername')
- ->will($this->returnValue('abcdefabcdef01234567890123456789'));
+ ->method('getUsername')
+ ->will($this->returnValue('abcdefabcdef01234567890123456789'));
// Stub client's getTransport method
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
}
/**
@@ -58,9 +58,9 @@ public function testFoundNoGroups()
{
// Stub transport's sendRequest method
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with($this->equalTo($this->mockClient->getUsername()))
- ->will($this->returnValue(new \stdClass));
+ ->method('sendRequest')
+ ->with($this->equalTo($this->mockClient->getUsername()))
+ ->will($this->returnValue(new \stdClass));
// Send command and get response
$response = $this->getGroups->send($this->mockClient);
@@ -87,9 +87,9 @@ public function testFoundGroups()
// Stub transport's sendRequest usage
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with($this->equalTo($this->mockClient->getUsername()))
- ->will($this->returnValue($mockTransportResults));
+ ->method('sendRequest')
+ ->with($this->equalTo($this->mockClient->getUsername()))
+ ->will($this->returnValue($mockTransportResults));
// Send command and get response
$response = $this->getGroups->send($this->mockClient);
View
14 tests/PhueTest/Command/GetLightByIdTest.php
@@ -38,13 +38,13 @@ public function setUp()
// Stub client's getUsername method
$this->mockClient->expects($this->any())
- ->method('getUsername')
- ->will($this->returnValue('abcdefabcdef01234567890123456789'));
+ ->method('getUsername')
+ ->will($this->returnValue('abcdefabcdef01234567890123456789'));
// Stub client getTransport usage
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
}
/**
@@ -57,9 +57,9 @@ public function testSend()
{
// Stub transport's sendRequest usage
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with("{$this->mockClient->getUsername()}/lights/10")
- ->will($this->returnValue(new \stdClass));
+ ->method('sendRequest')
+ ->with("{$this->mockClient->getUsername()}/lights/10")
+ ->will($this->returnValue(new \stdClass));
// Get light
$light = (new GetLightById(10))->send($this->mockClient);
View
20 tests/PhueTest/Command/GetLightsTest.php
@@ -40,13 +40,13 @@ public function setUp()
// Stub client's getUsername method
$this->mockClient->expects($this->any())
- ->method('getUsername')
- ->will($this->returnValue('abcdefabcdef01234567890123456789'));
+ ->method('getUsername')
+ ->will($this->returnValue('abcdefabcdef01234567890123456789'));
// Stub client's getTransport method
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
}
/**
@@ -58,9 +58,9 @@ public function testFoundNoLights()
{
// Stub transport's sendRequest method
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with($this->equalTo($this->mockClient->getUsername()))
- ->will($this->returnValue(new \stdClass));
+ ->method('sendRequest')
+ ->with($this->equalTo($this->mockClient->getUsername()))
+ ->will($this->returnValue(new \stdClass));
// Send command and get response
$response = $this->getLights->send($this->mockClient);
@@ -87,9 +87,9 @@ public function testFoundLights()
// Stub transport's sendRequest usage
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with($this->equalTo($this->mockClient->getUsername()))
- ->will($this->returnValue($mockTransportResults));
+ ->method('sendRequest')
+ ->with($this->equalTo($this->mockClient->getUsername()))
+ ->will($this->returnValue($mockTransportResults));
// Send command and get response
$response = $this->getLights->send($this->mockClient);
View
14 tests/PhueTest/Command/GetNewLightsTest.php
@@ -40,13 +40,13 @@ public function setUp()
// Stub client's getUsername method
$this->mockClient->expects($this->any())
- ->method('getUsername')
- ->will($this->returnValue('abcdefabcdef01234567890123456789'));
+ ->method('getUsername')
+ ->will($this->returnValue('abcdefabcdef01234567890123456789'));
// Stub client's getTransport method
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
// Mock transport results
$mockTransportResults = (object) [
@@ -57,9 +57,9 @@ public function setUp()
// Stub transport's sendRequest usage
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with($this->equalTo("{$this->mockClient->getUsername()}/lights/new"))
- ->will($this->returnValue($mockTransportResults));
+ ->method('sendRequest')
+ ->with($this->equalTo("{$this->mockClient->getUsername()}/lights/new"))
+ ->will($this->returnValue($mockTransportResults));
}
/**
View
14 tests/PhueTest/Command/GetScheduleByIdTest.php
@@ -38,13 +38,13 @@ public function setUp()
// Stub client's getUsername method
$this->mockClient->expects($this->any())
- ->method('getUsername')
- ->will($this->returnValue('abcdefabcdef01234567890123456789'));
+ ->method('getUsername')
+ ->will($this->returnValue('abcdefabcdef01234567890123456789'));
// Stub client getTransport usage
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
}
/**
@@ -57,9 +57,9 @@ public function testSend()
{
// Stub transport's sendRequest usage
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with("{$this->mockClient->getUsername()}/schedules/9")
- ->will($this->returnValue(new \stdClass));
+ ->method('sendRequest')
+ ->with("{$this->mockClient->getUsername()}/schedules/9")
+ ->will($this->returnValue(new \stdClass));
// Get schedule
$schedule = (new GetScheduleById(9))->send($this->mockClient);
View
20 tests/PhueTest/Command/GetSchedulesTest.php
@@ -40,13 +40,13 @@ public function setUp()
// Stub client's getUsername method
$this->mockClient->expects($this->any())
- ->method('getUsername')
- ->will($this->returnValue('abcdefabcdef01234567890123456789'));
+ ->method('getUsername')
+ ->will($this->returnValue('abcdefabcdef01234567890123456789'));
// Stub client's getTransport method
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
}
/**
@@ -58,9 +58,9 @@ public function testFoundNoSchedules()
{
// Stub transport's sendRequest method
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with($this->equalTo($this->mockClient->getUsername()))
- ->will($this->returnValue(new \stdClass));
+ ->method('sendRequest')
+ ->with($this->equalTo($this->mockClient->getUsername()))
+ ->will($this->returnValue(new \stdClass));
// Send command and get response
$response = $this->getSchedules->send($this->mockClient);
@@ -87,9 +87,9 @@ public function testFoundSchedules()
// Stub transport's sendRequest usage
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with($this->equalTo($this->mockClient->getUsername()))
- ->will($this->returnValue($mockTransportResults));
+ ->method('sendRequest')
+ ->with($this->equalTo($this->mockClient->getUsername()))
+ ->will($this->returnValue($mockTransportResults));
// Send command and get response
$response = $this->getSchedules->send($this->mockClient);
View
20 tests/PhueTest/Command/GetUsersTest.php
@@ -40,13 +40,13 @@ public function setUp()
// Stub client's getUsername method
$this->mockClient->expects($this->any())
- ->method('getUsername')
- ->will($this->returnValue('abcdefabcdef01234567890123456789'));
+ ->method('getUsername')
+ ->will($this->returnValue('abcdefabcdef01234567890123456789'));
// Stub client's getTransport method
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
}
/**
@@ -58,9 +58,9 @@ public function testFoundNoUsers()
{
// Stub transport's sendRequest method
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with($this->equalTo("{$this->mockClient->getUsername()}/config"))
- ->will($this->returnValue(new \stdClass));
+ ->method('sendRequest')
+ ->with($this->equalTo("{$this->mockClient->getUsername()}/config"))
+ ->will($this->returnValue(new \stdClass));
// Send command and get response
$response = $this->getUsers->send($this->mockClient);
@@ -87,9 +87,9 @@ public function testFoundUsers()
// Stub transport's sendRequest usage
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with($this->equalTo("{$this->mockClient->getUsername()}/config"))
- ->will($this->returnValue($mockTransportResults));
+ ->method('sendRequest')
+ ->with($this->equalTo("{$this->mockClient->getUsername()}/config"))
+ ->will($this->returnValue($mockTransportResults));
// Send command and get response
$response = $this->getUsers->send($this->mockClient);
View
26 tests/PhueTest/Command/IsAuthorizedTest.php
@@ -39,13 +39,13 @@ public function setUp()
// Stub client's getUsername method
$this->mockClient->expects($this->any())
- ->method('getUsername')
- ->will($this->returnValue('abcdefabcdef01234567890123456789'));
+ ->method('getUsername')
+ ->will($this->returnValue('abcdefabcdef01234567890123456789'));
// Stub client's getTransport method
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
}
/**
@@ -57,8 +57,8 @@ public function testIsAuthorized()
{
// Stub transport's sendRequest method
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with($this->equalTo($this->mockClient->getUsername()));
+ ->method('sendRequest')
+ ->with($this->equalTo($this->mockClient->getUsername()));
$this->assertTrue(
(new IsAuthorized)->send($this->mockClient)
@@ -74,13 +74,13 @@ public function testIsNotAuthorized()
{
// Stub transport's sendRequest
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with($this->equalTo($this->mockClient->getUsername()))
- ->will(
- $this->throwException(
- $this->getMock('\Phue\Transport\Exception\UnauthorizedUserException')
- )
- );
+ ->method('sendRequest')
+ ->with($this->equalTo($this->mockClient->getUsername()))
+ ->will(
+ $this->throwException(
+ $this->getMock('\Phue\Transport\Exception\UnauthorizedUserException')
+ )
+ );
$this->assertFalse(
(new IsAuthorized)->send($this->mockClient)
View
8 tests/PhueTest/Command/PingTest.php
@@ -38,8 +38,8 @@ public function setUp()
// Stub client getTransport usage
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
}
/**
@@ -51,8 +51,8 @@ public function testSend()
{
// Stub transport's sendRequest usage
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with($this->equalTo('none/config'));
+ ->method('sendRequest')
+ ->with($this->equalTo('none/config'));
(new Ping)->send($this->mockClient);
}
View
24 tests/PhueTest/Command/SetBridgeConfigTest.php
@@ -38,13 +38,13 @@ public function setUp()
// Stub client's getUsername method
$this->mockClient->expects($this->any())
- ->method('getUsername')
- ->will($this->returnValue('abcdefabcdef01234567890123456789'));
+ ->method('getUsername')
+ ->will($this->returnValue('abcdefabcdef01234567890123456789'));
// Stub client's getTransport method
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
}
/**
@@ -57,14 +57,14 @@ public function testSend()
{
// Stub transport's sendRequest usage
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with(
- $this->equalTo(
- "{$this->mockClient->getUsername()}/config"
- ),
- $this->equalTo('PUT'),
- $this->isInstanceOf('\stdClass')
- );
+ ->method('sendRequest')
+ ->with(
+ $this->equalTo(
+ "{$this->mockClient->getUsername()}/config"
+ ),
+ $this->equalTo('PUT'),
+ $this->isInstanceOf('\stdClass')
+ );
(new SetBridgeConfig(['name' => 'test']))->send($this->mockClient);
}
View
24 tests/PhueTest/Command/SetGroupAttributesTest.php
@@ -45,13 +45,13 @@ public function setUp()
// Stub client's getUsername method
$this->mockClient->expects($this->any())
- ->method('getUsername')
- ->will($this->returnValue('abcdefabcdef01234567890123456789'));
+ ->method('getUsername')
+ ->will($this->returnValue('abcdefabcdef01234567890123456789'));
// Stub client's getTransport method
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
}
/**
@@ -90,13 +90,13 @@ protected function stubTransportSendRequestWithPayload(\stdClass $payload)
{
// Stub transport's sendRequest usage
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with(
- $this->equalTo(
- "{$this->mockClient->getUsername()}/groups/{$this->mockGroup->getId()}"
- ),
- $this->equalTo('PUT'),
- $payload
- );
+ ->method('sendRequest')
+ ->with(
+ $this->equalTo(
+ "{$this->mockClient->getUsername()}/groups/{$this->mockGroup->getId()}"
+ ),
+ $this->equalTo('PUT'),
+ $payload
+ );
}
}
View
26 tests/PhueTest/Command/SetGroupStateTest.php
@@ -45,13 +45,13 @@ public function setUp()
// Stub client's getUsername method
$this->mockClient->expects($this->any())
- ->method('getUsername')
- ->will($this->returnValue('abcdefabcdef01234567890123456789'));
+ ->method('getUsername')
+ ->will($this->returnValue('abcdefabcdef01234567890123456789'));
// Stub client's getTransport method
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
}
/**
@@ -74,7 +74,7 @@ public function testSend()
// Change color temp and set state
$setGroupStateCmd->colorTemp(300)
- ->send($this->mockClient);
+ ->send($this->mockClient);
}
/**
@@ -112,13 +112,13 @@ protected function stubTransportSendRequestWithPayload(\stdClass $payload)
{
// Stub transport's sendRequest usage
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with(
- $this->equalTo(
- "{$this->mockClient->getUsername()}/groups/{$this->mockGroup->getId()}/action"
- ),
- $this->equalTo('PUT'),
- $payload
- );
+ ->method('sendRequest')
+ ->with(
+ $this->equalTo(
+ "{$this->mockClient->getUsername()}/groups/{$this->mockGroup->getId()}/action"
+ ),
+ $this->equalTo('PUT'),
+ $payload
+ );
}
}
View
24 tests/PhueTest/Command/SetLightNameTest.php
@@ -46,13 +46,13 @@ public function setUp()
// Stub client's getUsername method
$this->mockClient->expects($this->any())
- ->method('getUsername')
- ->will($this->returnValue('abcdefabcdef01234567890123456789'));
+ ->method('getUsername')
+ ->will($this->returnValue('abcdefabcdef01234567890123456789'));
// Stub client's getTransport method
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
}
/**
@@ -65,14 +65,14 @@ public function testSend()
{
// Stub transport's sendRequest usage
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with(
- $this->equalTo(
- "{$this->mockClient->getUsername()}/lights/{$this->mockLight->getId()}"
- ),
- $this->equalTo('PUT'),
- $this->isInstanceOf('\stdClass')
- );
+ ->method('sendRequest')
+ ->with(
+ $this->equalTo(
+ "{$this->mockClient->getUsername()}/lights/{$this->mockLight->getId()}"
+ ),
+ $this->equalTo('PUT'),
+ $this->isInstanceOf('\stdClass')
+ );
(new SetLightName($this->mockLight, 'Dummy name'))->send($this->mockClient);
}
View
24 tests/PhueTest/Command/SetLightStateTest.php
@@ -45,13 +45,13 @@ public function setUp()
// Stub client's getUsername method
$this->mockClient->expects($this->any())
- ->method('getUsername')
- ->will($this->returnValue('abcdefabcdef01234567890123456789'));
+ ->method('getUsername')
+ ->will($this->returnValue('abcdefabcdef01234567890123456789'));
// Stub client's getTransport method
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
}
/**
@@ -516,14 +516,14 @@ protected function stubTransportSendRequestWithPayload(\stdClass $payload)
{
// Stub transport's sendRequest usage
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with(
- $this->equalTo(
- "{$this->mockClient->getUsername()}/lights/{$this->mockLight->getId()}/state"
- ),
- $this->equalTo('PUT'),
- $payload
- );
+ ->method('sendRequest')
+ ->with(
+ $this->equalTo(
+ "{$this->mockClient->getUsername()}/lights/{$this->mockLight->getId()}/state"
+ ),
+ $this->equalTo('PUT'),
+ $payload
+ );
}
/**
View
8 tests/PhueTest/Command/SetScheduleAttributesTest.php
@@ -45,13 +45,13 @@ public function setUp()
// Stub client's getUsername method
$this->mockClient->expects($this->any())
- ->method('getUsername')
- ->will($this->returnValue('abcdefabcdef01234567890123456789'));
+ ->method('getUsername')
+ ->will($this->returnValue('abcdefabcdef01234567890123456789'));
// Stub client's getTransport method
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
// Mock schedulable command
$this->mockCommand = $this->getMock(
View
20 tests/PhueTest/Command/StartLightScanTest.php
@@ -38,13 +38,13 @@ public function setUp()
// Stub client's getUsername method
$this->mockClient->expects($this->any())
- ->method('getUsername')
- ->will($this->returnValue('abcdefabcdef01234567890123456789'));
+ ->method('getUsername')
+ ->will($this->returnValue('abcdefabcdef01234567890123456789'));
// Stub client's getTransport method
$this->mockClient->expects($this->any())
- ->method('getTransport')
- ->will($this->returnValue($this->mockTransport));
+ ->method('getTransport')
+ ->will($this->returnValue($this->mockTransport));
}
/**
@@ -56,12 +56,12 @@ public function testSend()
{
// Stub transport's sendRequest method
$this->mockTransport->expects($this->once())
- ->method('sendRequest')
- ->with(
- $this->equalTo($this->mockClient->getUsername() . '/lights'),
- $this->equalTo('POST')
- )
- ->will($this->returnValue('success!'));
+ ->method('sendRequest')
+ ->with(
+ $this->equalTo($this->mockClient->getUsername() . '/lights'),
+ $this->equalTo('POST')
+ )
+ ->will($this->returnValue('success!'));
$this->assertEquals(
(new StartLightScan)->send($this->mockClient),
View
20 tests/PhueTest/GroupTest.php
@@ -87,9 +87,9 @@ public function testSetName()
{
// Stub client's sendCommand method
$this->mockClient->expects($this->once())
- ->method('sendCommand')
- ->with($this->isInstanceOf('\Phue\Command\SetGroupAttributes'))
- ->will($this->returnValue($this->group));
+ ->method('sendCommand')
+ ->with($this->isInstanceOf('\Phue\Command\SetGroupAttributes'))
+ ->will($this->returnValue($this->group));
// Ensure setName returns self
$this->assertEquals(
@@ -127,9 +127,9 @@ public function testSetLights()
{
// Stub client's sendCommand method
$this->mockClient->expects($this->once())
- ->method('sendCommand')
- ->with($this->isInstanceOf('\Phue\Command\SetGroupAttributes'))
- ->will($this->returnValue($this->group));
+ ->method('sendCommand')
+ ->with($this->isInstanceOf('\Phue\Command\SetGroupAttributes'))
+ ->will($this->returnValue($this->group));
// Ensure setLights return self
$this->assertEquals(
@@ -365,8 +365,8 @@ public function testGetColormode()
public function testDelete()
{
$this->mockClient->expects($this->once())
- ->method('sendCommand')
- ->with($this->isInstanceOf('\Phue\Command\DeleteGroup'));
+ ->method('sendCommand')
+ ->with($this->isInstanceOf('\Phue\Command\DeleteGroup'));
$this->group->delete();
}
@@ -390,7 +390,7 @@ public function testToString()
protected function stubMockClientSendSetGroupStateCommand()
{
$this->mockClient->expects($this->once())
- ->method('sendCommand')
- ->with($this->isInstanceOf('\Phue\Command\SetGroupState'));
+ ->method('sendCommand')
+ ->with($this->isInstanceOf('\Phue\Command\SetGroupState'));
}
}
View
10 tests/PhueTest/LightTest.php
@@ -90,9 +90,9 @@ public function testSetName()
{
// Stub client's sendCommand method
$this->mockClient->expects($this->once())
- ->method('sendCommand')
- ->with($this->isInstanceOf('\Phue\Command\SetLightName'))
- ->will($this->returnValue($this->light));
+ ->method('sendCommand')
+ ->with($this->isInstanceOf('\Phue\Command\SetLightName'))
+ ->will($this->returnValue($this->light));
// Ensure setName returns self
$this->assertEquals(
@@ -407,7 +407,7 @@ public function testToString()
protected function stubMockClientSendSetLightStateCommand()
{
$this->mockClient->expects($this->once())
- ->method('sendCommand')
- ->with($this->isInstanceOf('\Phue\Command\SetLightState'));
+ ->method('sendCommand')
+ ->with($this->isInstanceOf('\Phue\Command\SetLightState'));
}
}
View
12 tests/PhueTest/Transport/HttpTest.php
@@ -247,17 +247,17 @@ protected function stubMockAdapterResponseMethods($response, $httpStatusCode, $c
{
// Stub send method on transport adapter
$this->mockAdapter->expects($this->once())
- ->method('send')
- ->will($this->returnValue(json_encode($response)));
+ ->method('send')
+ ->will($this->returnValue(json_encode($response)));
// Stub getHttpStatusCode on transport adapter
$this->mockAdapter->expects($this->once())
- ->method('getHttpStatusCode')
- ->will($this->returnValue($httpStatusCode));
+ ->method('getHttpStatusCode')
+ ->will($this->returnValue($httpStatusCode));
// Stub getContentType on transport adapter
$this->mockAdapter->expects($this->once())
- ->method('getContentType')
- ->will($this->returnValue($contentType));
+ ->method('getContentType')
+ ->will($this->returnValue($contentType));
}
}
View
4 tests/PhueTest/UserTest.php
@@ -104,8 +104,8 @@ public function testGetLastUseDate()
public function testDelete()
{
$this->mockClient->expects($this->once())
- ->method('sendCommand')
- ->with($this->isInstanceOf('\Phue\Command\DeleteUser'));
+ ->method('sendCommand')
+ ->with($this->isInstanceOf('\Phue\Command\DeleteUser'));
$this->user->delete();
}
Please sign in to comment.
Something went wrong with that request. Please try again.