Exporting and Importing ICS-Files

This commit is contained in:
Tobias Hößl 2012-07-14 17:02:21 +00:00
parent a96c8ce670
commit 66384e2e2c
16 changed files with 245 additions and 47 deletions

View file

@ -707,6 +707,51 @@ class Sabre_VObject_RecurrenceIteratorTest extends PHPUnit_Framework_TestCase {
}
/**
* @depends testValues
*/
function testYearlyLeapYear() {
$ev = new Sabre_VObject_Component('VEVENT');
$ev->UID = 'bla';
$ev->RRULE = 'FREQ=YEARLY;COUNT=3';
$dtStart = new Sabre_VObject_Property_DateTime('DTSTART');
$dtStart->setDateTime(new DateTime('2012-02-29'),Sabre_VObject_Property_DateTime::UTC);
$ev->add($dtStart);
$vcal = Sabre_VObject_Component::create('VCALENDAR');
$vcal->add($ev);
$it = new Sabre_VObject_RecurrenceIterator($vcal,(string)$ev->uid);
$this->assertEquals('yearly', $it->frequency);
$this->assertEquals(3, $it->count);
$max = 20;
$result = array();
foreach($it as $k=>$item) {
$result[] = $item;
$max--;
if (!$max) break;
}
$tz = new DateTimeZone('UTC');
$this->assertEquals(
array(
new DateTime('2012-02-29', $tz),
new DateTime('2016-02-29', $tz),
new DateTime('2020-02-29', $tz),
),
$result
);
}
/**
* @depends testValues
*/