Skip to content

Commit

Permalink
Fix existing tests for UNTIL values.
Browse files Browse the repository at this point in the history
These are inclusive, and compared via datetime values, so we MUST
persist the full datetime when parsing the RRULE.
  • Loading branch information
mrubinsk committed Dec 6, 2013
1 parent 2fec6b8 commit 37b0ccb
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions framework/Date/test/Horde/Date/RecurrenceTest.php
Expand Up @@ -531,7 +531,7 @@ public function testParseDaily()
$this->assertEquals(2, $r->getRecurInterval());
$this->assertNull($r->getRecurOnDays());
$this->assertNull($r->getRecurCount());
$this->assertEquals('2007-03-08 09:00:00', (string)$r->recurEnd);
$this->assertEquals('2007-03-08 09:00:00', (string)$r->recurEnd->setTimezone('UTC'));

$r->fromRRule10('D2 #4');
$this->assertEquals(Horde_Date_Recurrence::RECUR_DAILY, $r->getRecurType());
Expand All @@ -551,7 +551,7 @@ public function testParseDaily()
$this->assertEquals(2, $r->getRecurInterval());
$this->assertNull($r->getRecurOnDays());
$this->assertNull($r->getRecurCount());
$this->assertEquals('2007-03-08 00:00:00', (string)$r->recurEnd);
$this->assertEquals('2007-03-08 09:00:00', (string)$r->recurEnd->setTimezone('UTC'));

$r->fromRRule20('FREQ=DAILY;INTERVAL=2;COUNT=4');
$this->assertEquals(Horde_Date_Recurrence::RECUR_DAILY, $r->getRecurType());
Expand All @@ -575,7 +575,7 @@ public function testParseWeekly()
$this->assertEquals(1, $r->getRecurInterval());
$this->assertEquals(Horde_Date::MASK_THURSDAY, $r->getRecurOnDays());
$this->assertNull($r->getRecurCount());
$this->assertEquals('2007-03-30 08:00:00', (string)$r->recurEnd);
$this->assertEquals('2007-03-30 08:00:00', (string)$r->recurEnd->setTimezone('UTC'));

$r->fromRRule10('W1 SU MO TU WE TH FR SA 20070603T235959');
$this->assertEquals(Horde_Date_Recurrence::RECUR_WEEKLY, $r->getRecurType());
Expand Down Expand Up @@ -608,7 +608,7 @@ public function testParseWeekly()
$this->assertEquals(1, $r->getRecurInterval());
$this->assertEquals(Horde_Date::MASK_THURSDAY, $r->getRecurOnDays());
$this->assertNull($r->getRecurCount());
$this->assertEquals('2007-03-30 00:00:00', (string)$r->recurEnd);
$this->assertEquals('2007-03-30 08:00:00', (string)$r->recurEnd->setTimezone('UTC'));

$r->fromRRule20('FREQ=WEEKLY;INTERVAL=1;BYDAY=TH;COUNT=4');
$this->assertEquals(Horde_Date_Recurrence::RECUR_WEEKLY, $r->getRecurType());
Expand Down Expand Up @@ -650,7 +650,7 @@ public function testParseMonthlyDate()
$this->assertEquals(1, $r->getRecurInterval());
$this->assertNull($r->getRecurOnDays());
$this->assertNull($r->getRecurCount());
$this->assertEquals('2007-05-02 08:00:00', (string)$r->recurEnd);
$this->assertEquals('2007-05-02 08:00:00', (string)$r->recurEnd->setTimezone('UTC'));

$r->fromRRule10('MD1 1 #4');
$this->assertEquals(Horde_Date_Recurrence::RECUR_MONTHLY_DATE, $r->getRecurType());
Expand All @@ -676,7 +676,7 @@ public function testParseMonthlyDate()
$this->assertEquals(1, $r->getRecurInterval());
$this->assertNull($r->getRecurOnDays());
$this->assertNull($r->getRecurCount());
$this->assertEquals('2007-05-02 00:00:00', (string)$r->recurEnd);
$this->assertEquals('2007-05-02 08:00:00', (string)$r->recurEnd->setTimezone('UTC'));

$r->fromRRule20('FREQ=MONTHLY;INTERVAL=1;COUNT=4');
$this->assertEquals(Horde_Date_Recurrence::RECUR_MONTHLY_DATE, $r->getRecurType());
Expand Down Expand Up @@ -706,7 +706,7 @@ public function testParseMonthlyWeekday()
$this->assertEquals(1, $r->getRecurInterval());
$this->assertNull($r->getRecurOnDays());
$this->assertNull($r->getRecurCount());
$this->assertEquals('2007-05-02 08:00:00', (string)$r->recurEnd);
$this->assertEquals('2007-05-02 08:00:00', (string)$r->recurEnd->setTimezone('UTC'));

$r->fromRRule10('MP1 1+ TH #4');
$this->assertEquals(Horde_Date_Recurrence::RECUR_MONTHLY_WEEKDAY, $r->getRecurType());
Expand All @@ -726,7 +726,7 @@ public function testParseMonthlyWeekday()
$this->assertEquals(1, $r->getRecurInterval());
$this->assertNull($r->getRecurOnDays());
$this->assertNull($r->getRecurCount());
$this->assertEquals('2007-05-02 00:00:00', (string)$r->recurEnd);
$this->assertEquals('2007-05-02 08:00:00', (string)$r->recurEnd->setTimezone('UTC'));

$r->fromRRule20('FREQ=MONTHLY;INTERVAL=1;BYDAY=1TH;COUNT=4');
$this->assertEquals(Horde_Date_Recurrence::RECUR_MONTHLY_WEEKDAY, $r->getRecurType());
Expand All @@ -750,7 +750,7 @@ public function testParseYearlyDate()
$this->assertEquals(1, $r->getRecurInterval());
$this->assertNull($r->getRecurOnDays());
$this->assertNull($r->getRecurCount());
$this->assertEquals('2009-03-02 09:00:00', (string)$r->recurEnd);
$this->assertEquals('2009-03-02 09:00:00', (string)$r->recurEnd->setTimezone('UTC'));

$r->fromRRule10('YM1 3 #4');
$this->assertEquals(Horde_Date_Recurrence::RECUR_YEARLY_DATE, $r->getRecurType());
Expand All @@ -770,7 +770,7 @@ public function testParseYearlyDate()
$this->assertEquals(1, $r->getRecurInterval());
$this->assertNull($r->getRecurOnDays());
$this->assertNull($r->getRecurCount());
$this->assertEquals('2009-03-02 00:00:00', (string)$r->recurEnd);
$this->assertEquals('2009-03-02 09:00:00', (string)$r->recurEnd->setTimezone('UTC'));

$r->fromRRule20('FREQ=YEARLY;INTERVAL=1;COUNT=4');
$this->assertEquals(Horde_Date_Recurrence::RECUR_YEARLY_DATE, $r->getRecurType());
Expand All @@ -794,7 +794,7 @@ public function testParseYearlyDay()
$this->assertEquals(1, $r->getRecurInterval());
$this->assertNull($r->getRecurOnDays());
$this->assertNull($r->getRecurCount());
$this->assertEquals('2009-03-02 09:00:00', (string)$r->recurEnd);
$this->assertEquals('2009-03-02 09:00:00', (string)$r->recurEnd->setTimezone('UTC'));

$r->fromRRule10('YD1 60 #4');
$this->assertEquals(Horde_Date_Recurrence::RECUR_YEARLY_DAY, $r->getRecurType());
Expand All @@ -814,7 +814,7 @@ public function testParseYearlyDay()
$this->assertEquals(1, $r->getRecurInterval());
$this->assertNull($r->getRecurOnDays());
$this->assertNull($r->getRecurCount());
$this->assertEquals('2009-03-02 00:00:00', (string)$r->recurEnd);
$this->assertEquals('2009-03-02 09:00:00', (string)$r->recurEnd->setTimezone('UTC'));

$r->fromRRule20('FREQ=YEARLY;INTERVAL=1;BYYEARDAY=60;COUNT=4');
$this->assertEquals(Horde_Date_Recurrence::RECUR_YEARLY_DAY, $r->getRecurType());
Expand All @@ -838,7 +838,7 @@ public function testParseYearlyWeekday()
$this->assertEquals(1, $r->getRecurInterval());
$this->assertNull($r->getRecurOnDays());
$this->assertNull($r->getRecurCount());
$this->assertEquals('2009-03-02 00:00:00', (string)$r->recurEnd);
$this->assertEquals('2009-03-02 09:00:00', (string)$r->recurEnd->setTimezone('UTC'));

$r->fromRRule20('FREQ=YEARLY;INTERVAL=1;BYDAY=1TH;BYMONTH=3;COUNT=4');
$this->assertEquals(Horde_Date_Recurrence::RECUR_YEARLY_WEEKDAY, $r->getRecurType());
Expand Down

0 comments on commit 37b0ccb

Please sign in to comment.