Inheritance: implements Phue\Command\CommandInterface
Example #1
0
 /**
  * Test: Send get light by id command
  *
  * @covers \Phue\Command\GetLightById::__construct
  * @covers \Phue\Command\GetLightById::send
  */
 public function testSend()
 {
     // Stub transport's sendRequest usage
     $this->mockTransport->expects($this->once())->method('sendRequest')->with("/api/{$this->mockClient->getUsername()}/lights/10")->will($this->returnValue(new \stdClass()));
     // Get light
     $x = new GetLightById(10);
     $light = $x->send($this->mockClient);
     // Ensure type is correct
     $this->assertInstanceOf('\\Phue\\Light', $light);
 }