-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* Phue: Philips Hue PHP Client | ||
* | ||
* @author Michael Squires <sqmk@php.net> | ||
* @copyright Copyright (c) 2012-2014 Michael K. Squires | ||
* @license http://github.com/sqmk/Phue/wiki/License | ||
*/ | ||
|
||
namespace Phue\Test\TimePattern; | ||
|
||
use Phue\TimePattern\AbsoluteTime; | ||
|
||
/** | ||
* Tests for Phue\TimePattern\AbsoluteTime | ||
*/ | ||
class AbsoluteTimeTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* Test: Creating absolute time | ||
* | ||
* @covers \Phue\TimePattern\AbsoluteTime | ||
*/ | ||
public function testCreateTime() | ||
{ | ||
$this->assertRegExp( | ||
'/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/', | ||
(string) new AbsoluteTime('now') | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* Phue: Philips Hue PHP Client | ||
* | ||
* @author Michael Squires <sqmk@php.net> | ||
* @copyright Copyright (c) 2012-2014 Michael K. Squires | ||
* @license http://github.com/sqmk/Phue/wiki/License | ||
*/ | ||
|
||
namespace Phue\Test\TimePattern; | ||
|
||
use Phue\TimePattern\RandomizedTime; | ||
|
||
/** | ||
* Tests for Phue\TimePattern\RandomizedTime | ||
*/ | ||
class RandomizedTimeTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* Test: Creating randomized time | ||
* | ||
* @covers \Phue\TimePattern\RandomizedTime | ||
*/ | ||
public function testCreateTime() | ||
{ | ||
$this->assertRegExp( | ||
'/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}A01:01:20$/', | ||
(string) new RandomizedTime('now', 3680) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
/** | ||
* Phue: Philips Hue PHP Client | ||
* | ||
* @author Michael Squires <sqmk@php.net> | ||
* @copyright Copyright (c) 2012-2014 Michael K. Squires | ||
* @license http://github.com/sqmk/Phue/wiki/License | ||
*/ | ||
|
||
namespace Phue\Test\TimePattern; | ||
|
||
use Phue\TimePattern\RecurringTime; | ||
|
||
/** | ||
* Tests for Phue\TimePattern\RecurringTime | ||
*/ | ||
class RecurringTimeTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* Test: Creating recurring time | ||
* | ||
* @covers \Phue\TimePattern\RecurringTime | ||
*/ | ||
public function testCreateTime() | ||
{ | ||
$this->assertRegExp( | ||
'/^W34\/T14:02:05$/', | ||
(string) new RecurringTime( | ||
RecurringTime::TUESDAY | RecurringTime::SATURDAY, 14, 2, 5 | ||
) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* Phue: Philips Hue PHP Client | ||
* | ||
* @author Michael Squires <sqmk@php.net> | ||
* @copyright Copyright (c) 2012-2014 Michael K. Squires | ||
* @license http://github.com/sqmk/Phue/wiki/License | ||
*/ | ||
|
||
namespace Phue\Test\TimePattern; | ||
|
||
use Phue\TimePattern\Timer; | ||
|
||
/** | ||
* Tests for Phue\TimePattern\Timer | ||
*/ | ||
class TimerTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* Test: Creating recurring time | ||
* | ||
* @covers \Phue\TimePattern\Timer | ||
*/ | ||
public function testCreateTime() | ||
{ | ||
$this->assertRegExp( | ||
'/^R12\/PT01:05:25$/', | ||
(string) (new Timer(3925))->repeat(12) | ||
); | ||
} | ||
} |