From: Gunnar Wrobel Date: Mon, 9 Nov 2009 08:43:57 +0000 (+0100) Subject: Add failing test for recurrences with limited occurence that have X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f6f870dde066c9b336328bcc3bfeb06c6ad181bf;p=horde.git Add failing test for recurrences with limited occurence that have multiple incidences per week. From https://issues.kolab.org/issue3846: horde counts recurring events per week and not per incident. This gets a problem if a recurring event with more than one incident per week is defined. A recurring event with incidents on monday and friday with 3 incidents overall is displayed correctly with 3 incidents over one and a half week in kontact and Outlook. Without this patch horde displays 6 incidents over 3 weeks. --- diff --git a/framework/Date/test/Horde/Date/RecurrenceTest.php b/framework/Date/test/Horde/Date/RecurrenceTest.php index 8e69bdc09..c3549d6e3 100644 --- a/framework/Date/test/Horde/Date/RecurrenceTest.php +++ b/framework/Date/test/Horde/Date/RecurrenceTest.php @@ -137,6 +137,21 @@ class Horde_Date_RecurrenceTest extends PHPUnit_Framework_TestCase $this->_getRecurrences($r)); } + public function testWeeklyCountWithMultipleIncidencesPerWeek() + { + $r = new Horde_Date_Recurrence('2007-03-01 10:00:00'); + $r->setRecurType(Horde_Date_Recurrence::RECUR_WEEKLY); + $r->setRecurOnDay(Horde_Date::MASK_THURSDAY | Horde_Date::MASK_SATURDAY); + $r->setRecurInterval(1); + $r->setRecurCount(3); + $this->assertEquals('W1 TH SA #3', $r->toRRule10($this->ical)); + $this->assertEquals('FREQ=WEEKLY;INTERVAL=1;BYDAY=TH,SA;COUNT=3', $r->toRRule20($this->ical)); + $this->assertEquals(array('2007-03-01 10:00:00', + '2007-03-03 10:00:00', + '2007-03-10 10:00:00',), + $this->_getRecurrences($r)); + } + public function testMonthlyEnd() { $r = new Horde_Date_Recurrence('2007-03-01 10:00:00');