mirror of
https://github.com/rlanvin/php-rrule.git
synced 2025-02-17 06:54:15 +01:00
Add tests
This commit is contained in:
parent
0785c6ce7d
commit
8d54335802
@ -63,7 +63,7 @@
|
||||
### Fixed
|
||||
|
||||
- Fix bug preventing the iteration of multiple instances of RRule at the same time
|
||||
- Fix occursAt failing when the date passed was a different timezone [#8](https://github.com/rlanvin/php-rrule/pull/8)
|
||||
- Fix `occursAt` failing when the date passed was a different timezone [#8](https://github.com/rlanvin/php-rrule/pull/8)
|
||||
- Fix bug at WEEKLY frequency with a partially filled cache in some circumstances
|
||||
- Fix various reference bugs causing corruption of the cache in some circumstances (related to DateTime object being mutable)
|
||||
|
||||
|
@ -2164,10 +2164,24 @@ class RRuleTest extends PHPUnit_Framework_TestCase
|
||||
public function testGetRule()
|
||||
{
|
||||
$array = array(
|
||||
'FREQ' => 'YEARLY'
|
||||
'FREQ' => 'YEARLY',
|
||||
'DTSTART' => '2016-01-01'
|
||||
);
|
||||
$rrule = new RRule($array);
|
||||
$this->assertInternalType('array', $rrule->getRule());
|
||||
$rule = $rrule->getRule();
|
||||
$this->assertEquals('YEARLY', $rule['FREQ']);
|
||||
$this->assertInternalType('string', $rule['DTSTART']);
|
||||
|
||||
$rrule = new RRule("DTSTART;TZID=America/New_York:19970901T090000\nRRULE:FREQ=HOURLY;UNTIL=19971224T000000Z;WKST=SU;BYDAY=MO,WE,FR;BYMONTH=1;BYHOUR=1");
|
||||
$rule = $rrule->getRule();
|
||||
$this->assertEquals('HOURLY', $rule['FREQ']);
|
||||
$this->assertTrue($rule['DTSTART'] instanceof \DateTime);
|
||||
|
||||
$rrule = new RRule("DTSTART:19970901\nRRULE:FREQ=DAILY;UNTIL=19971224;WKST=SU;BYDAY=MO,WE,FR;BYMONTH=1");
|
||||
$rule = $rrule->getRule();
|
||||
$this->assertEquals('DAILY', $rule['FREQ']);
|
||||
$this->assertTrue($rule['DTSTART'] instanceof \DateTime);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
x
Reference in New Issue
Block a user