]> git.mxchange.org Git - friendica-addons.git/blob - dav/SabreDAV/tests/Sabre/VObject/RecurrenceIteratorFifthTuesdayProblemTest.php
Merge branch 'master' of git://github.com/friendica/friendica-addons
[friendica-addons.git] / dav / SabreDAV / tests / Sabre / VObject / RecurrenceIteratorFifthTuesdayProblemTest.php
1 <?php
2
3 class Sabre_VObject_RecurrenceIteratorFifthTuesdayProblemTest extends PHPUnit_Framework_TestCase {
4
5     function testGetDTEnd() {
6
7         $ics = <<<ICS
8 BEGIN:VCALENDAR
9 VERSION:2.0
10 PRODID:-//Apple Inc.//iCal 4.0.4//EN
11 CALSCALE:GREGORIAN
12 BEGIN:VEVENT
13 TRANSP:OPAQUE
14 DTEND;TZID=America/New_York:20070925T170000
15 UID:uuid
16 DTSTAMP:19700101T000000Z
17 LOCATION:
18 DESCRIPTION:
19 STATUS:CONFIRMED
20 SEQUENCE:18
21 SUMMARY:Stuff
22 DTSTART;TZID=America/New_York:20070925T160000
23 CREATED:20071004T144642Z
24 RRULE:FREQ=MONTHLY;INTERVAL=1;UNTIL=20071030T035959Z;BYDAY=5TU
25 END:VEVENT
26 END:VCALENDAR
27 ICS;
28
29         $vObject = Sabre_VObject_Reader::read($ics);
30         $it = new Sabre_VObject_RecurrenceIterator($vObject, (string)$vObject->VEVENT->UID);
31
32         while($it->valid()) {
33             $it->next();
34         }
35
36         // If we got here, it means we were successful. The bug that was in teh 
37         // system before would fail on the 5th tuesday of the month, if the 5th 
38         // tuesday did not exist.
39        
40     }
41
42 }
43
44 ?>