Phue\Command\DeleteRule::send PHP Method

send() public method

Send command
public send ( Client $client )
$client Phue\Client Phue Client
    public function send(Client $client)
    {
        $client->getTransport()->sendRequest("/api/{$client->getUsername()}/rules/{$this->ruleId}", TransportInterface::METHOD_DELETE);
    }

Usage Example

Example #1
0
 /**
  * Test: Send command
  *
  * @covers \Phue\Command\DeleteRule::__construct
  * @covers \Phue\Command\DeleteRule::send
  */
 public function testSend()
 {
     $command = new DeleteRule(5);
     // Stub transport's sendRequest usage
     $this->mockTransport->expects($this->once())->method('sendRequest')->with($this->equalTo("/api/{$this->mockClient->getUsername()}/rules/5"), $this->equalTo(TransportInterface::METHOD_DELETE));
     // Send command
     $command->send($this->mockClient);
 }