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