diff --git a/examples/list-rules.php b/examples/list-rules.php index e439cfe..29bec06 100644 --- a/examples/list-rules.php +++ b/examples/list-rules.php @@ -14,7 +14,7 @@ foreach ($client->getRules() as $rule) { echo "\t", "#{$rule->getId()} - {$rule->getName()}", "\n", "\t\t", "Last Triggered Time: {$rule->getLastTriggeredTime()}", "\n", - "\t\t", "Creation time: {$rule->getCreationTime()}", "\n", + "\t\t", "Created date: {$rule->getCreatedDate()}", "\n", "\t\t", "Times triggered: {$rule->getTriggeredCount()}", "\n", "\t\t", "Owner: {$rule->getOwner()}", "\n", "\t\t", "Status: ", $rule->isEnabled() ? 'Yes' : 'No', "\n"; diff --git a/library/Phue/Rule.php b/library/Phue/Rule.php index 19a982a..6cf5448 100644 --- a/library/Phue/Rule.php +++ b/library/Phue/Rule.php @@ -92,13 +92,13 @@ public function getLastTriggeredTime() } /** - * Get creation time + * Get create date * * @return string Time */ - public function getCreationTime() + public function getCreateDate() { - return $this->attributes->creationtime; + return $this->attributes->created; } /** diff --git a/tests/Phue/Test/RuleTest.php b/tests/Phue/Test/RuleTest.php index 1c3ae62..bb8c0bc 100644 --- a/tests/Phue/Test/RuleTest.php +++ b/tests/Phue/Test/RuleTest.php @@ -35,7 +35,7 @@ public function setUp() $this->attributes = (object) [ 'name' => 'Wall Switch Rule', 'lasttriggered' => '2013-10-17T01:23:20', - 'creationtime' => '2013-10-10T21:11:45', + 'created' => '2013-10-10T21:11:45', 'timestriggered' => 27, 'owner' => '78H56B12BA', 'status' => 'enabled', @@ -105,14 +105,14 @@ public function testGetLastTriggeredTime() } /** - * Test: Getting creation time + * Test: Getting create date * - * @covers \Phue\Rule::getCreationTime + * @covers \Phue\Rule::getCreateDate */ - public function testGetCreationTime() + public function testGetCreateDate() { $this->assertEquals( - $this->attributes->creationtime, + $this->attributes->created, $this->rule->getCreationTime() ); }