Phue\Command\SetGroupState::getActionableParams PHP Method

getActionableParams() public method

Get actionable params
public getActionableParams ( Client $client ) : array
$client Phue\Client Phue Client
return array Key/value pairs of params
    public function getActionableParams(Client $client)
    {
        return array('address' => "/groups/{$this->groupId}/action", 'method' => TransportInterface::METHOD_PUT, 'body' => (object) $this->params);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Test: Get actionable params
  *
  * @covers \Phue\Command\SetGroupState::getActionableParams
  */
 public function testGetActionableParams()
 {
     // Build command
     $setGroupStateCmd = new SetGroupState($this->mockGroup);
     // Change alert
     $setGroupStateCmd->alert('select');
     // Ensure schedulable params are expected
     $this->assertEquals(['address' => "/groups/{$this->mockGroup->getId()}/action", 'method' => 'PUT', 'body' => (object) ['alert' => 'select']], $setGroupStateCmd->getActionableParams($this->mockClient));
 }