summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-02-06 09:55:25 (GMT)
committerThomas Bruederli <thomas@roundcube.net>2014-02-06 09:55:25 (GMT)
commit7d39a1808a041143d3829c8e38d3d3376948f384 (patch)
tree2b8a786b4acf4ac68edd06f2012ea7c07a1d330d
parent10f5a485316c6df798c756c4e8518ac939c6ffc7 (diff)
downloadroundcubemail-plugins-kolab-7d39a1808a041143d3829c8e38d3d3376948f384.tar.gz
Add unit test for commit 10f5a48
-rw-r--r--plugins/libcalendaring/tests/libvcalendar.php5
-rw-r--r--plugins/libcalendaring/tests/resources/recurrence-id.ics31
2 files changed, 36 insertions, 0 deletions
diff --git a/plugins/libcalendaring/tests/libvcalendar.php b/plugins/libcalendaring/tests/libvcalendar.php
index 0726c98..8526c5b 100644
--- a/plugins/libcalendaring/tests/libvcalendar.php
+++ b/plugins/libcalendaring/tests/libvcalendar.php
@@ -142,6 +142,11 @@ class libvcalendar_test extends PHPUnit_Framework_TestCase
// categories, class
$this->assertEquals('libcalendaring tests', join(',', (array)$event['categories']), "Event categories");
$this->assertEquals('confidential', $event['sensitivity'], "Class/sensitivity = confidential");
+
+ // parse a reccuence chain instance
+ $events = $ical->import_from_file(__DIR__ . '/resources/recurrence-id.ics', 'UTF-8');
+ $this->assertEquals(1, count($events), "Fall back to Component::getComponents() when getBaseComponents() is empty");
+ $this->assertInstanceOf('DateTime', $events[0]['recurrence_date'], "Recurrence-ID as date");
}
/**
diff --git a/plugins/libcalendaring/tests/resources/recurrence-id.ics b/plugins/libcalendaring/tests/resources/recurrence-id.ics
new file mode 100644
index 0000000..41485f9
--- /dev/null
+++ b/plugins/libcalendaring/tests/resources/recurrence-id.ics
@@ -0,0 +1,31 @@
+BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//Lotus Development Corporation//NONSGML Notes 8.5.3//EN_C
+METHOD:REQUEST
+BEGIN:VTIMEZONE
+TZID:W. Europe
+BEGIN:STANDARD
+DTSTART:19501029T020000
+TZOFFSETFROM:+0200
+TZOFFSETTO:+0100
+RRULE:FREQ=YEARLY;BYMINUTE=0;BYHOUR=2;BYDAY=-1SU;BYMONTH=10
+END:STANDARD
+BEGIN:DAYLIGHT
+DTSTART:19500326T020000
+TZOFFSETFROM:+0100
+TZOFFSETTO:+0200
+RRULE:FREQ=YEARLY;BYMINUTE=0;BYHOUR=2;BYDAY=-1SU;BYMONTH=3
+END:DAYLIGHT
+END:VTIMEZONE
+BEGIN:VEVENT
+DTSTART;TZID="W. Europe":20140230T150000
+DTEND;TZID="W. Europe":20140230T163000
+TRANSP:OPAQUE
+RDATE;TZID="W. Europe";VALUE=PERIOD:20140227T140000/20140227T153000
+RECURRENCE-ID:20140227T130000Z
+SEQUENCE:0
+UID:7e93e8e8eef16f28aa33b78cd73613ebff
+DTSTAMP:20140120T105609Z
+SUMMARY:Invitation with Recurrence-ID
+END:VEVENT
+END:VCALENDAR