Inheritance: extends CreateSchedule, implements Phue\Command\CommandInterface
 /**
  * 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);
 }
 /**
  * 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);
 }
示例#3
0
 /**
  * Set time
  *
  * @param string $time Time
  *
  * @return Schedule Self object
  */
 public function setTime($time)
 {
     // Init command
     $command = new SetScheduleAttributes($this);
     // Build new time
     $time = $command->convertTimeToUtcDate($time);
     // Update the time, and set internal attribute
     $this->client->sendCommand($command->time($time));
     $this->attributes->time = $time;
     return $this;
 }
示例#4
0
文件: Schedule.php 项目: sqmk/phue
 /**
  * Set auto delete
  *
  * @param bool $flag
  *            True to auto delete, false if not
  *
  * @return self This object
  */
 public function setAutoDelete($flag)
 {
     $x = new SetScheduleAttributes($this);
     $y = $x->autodelete((bool) $flag);
     $this->client->sendCommand($y);
     $this->attributes->autodelete = (bool) $flag;
     return $this;
 }