Skip to content

Commit

Permalink
GitHub #98 - creationtime > created
Browse files Browse the repository at this point in the history
  • Loading branch information
sqmk committed Nov 22, 2015
1 parent c0d19ba commit e36e3dd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/list-rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
6 changes: 3 additions & 3 deletions library/Phue/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
10 changes: 5 additions & 5 deletions tests/Phue/Test/RuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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()
);
}
Expand Down

0 comments on commit e36e3dd

Please sign in to comment.