/**
  * Test: Send command
  *
  * @covers \Phue\Command\SetScheduleAttributes::__construct
  * @covers \Phue\Command\SetScheduleAttributes::send
  */
 public function testSend()
 {
     // Build command
     $setScheduleAttributesCmd = new SetScheduleAttributes($this->mockSchedule);
     // Set expected payload
     $this->stubTransportSendRequestWithPayload((object) ['name' => 'Dummy!', 'description' => 'Dummy description', 'command' => ['method' => TransportInterface::METHOD_POST, 'address' => "/api/{$this->mockClient->getUsername()}/thing/value", 'body' => "Dummy"]]);
     // Change name, description
     $setScheduleAttributesCmd->name('Dummy!')->description('Dummy description')->command($this->mockCommand)->send($this->mockClient);
 }
 /**
  * Test: Send command
  *
  * @covers \Phue\Command\SetScheduleAttributes::__construct
  * @covers \Phue\Command\SetScheduleAttributes::send
  */
 public function testSend()
 {
     // Build command
     $setScheduleAttributesCmd = new SetScheduleAttributes($this->mockSchedule);
     // Set expected payload
     $this->stubTransportSendRequestWithPayload((object) ['name' => 'Dummy!', 'description' => 'Dummy description', 'command' => null]);
     // Change name, description
     $setScheduleAttributesCmd->name('Dummy!')->description('Dummy description')->command($this->mockCommand)->send($this->mockClient);
 }
Esempio n. 3
0
 /**
  * Set name of schedule
  *
  * @param string $name
  *
  * @return self This object
  */
 public function setName($name)
 {
     $x = new SetScheduleAttributes($this);
     $y = $x->name((string) $name);
     $this->client->sendCommand($y);
     $this->attributes->name = (string) $name;
     return $this;
 }