Permalink
Browse files

GitHub #9 - Change indentation on chaining.

  • Loading branch information...
1 parent 29e0b4d commit 090cfca3d2e8a604e07ad4eb482ccc60bfdcd61e @sqmk committed Apr 3, 2013
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
@@ -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(
@@ -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),
@@ -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);
@@ -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);
@@ -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),
@@ -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);
@@ -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);
@@ -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);
@@ -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);
Oops, something went wrong.

0 comments on commit 090cfca

Please sign in to comment.