send() public method

Send command
public send ( Client $client ) : integer
$client Phue\Client Phue Client
return integer Sensor Id
Example #1
0
 /**
  * Test: Send
  *
  * @covers \Phue\Command\CreateSensor::send
  */
 public function testSend()
 {
     // Mock client
     $mockClient = Mockery::mock('\\Phue\\Client', array('getUsername' => 'abcdefabcdef01234567890123456789'))->makePartial();
     // Mock client commands
     $mockClient->shouldReceive('getTransport->sendRequest')->andReturn((object) array('id' => '5'));
     $command = new CreateSensor('test');
     $this->assertEquals('5', $command->send($mockClient));
 }