ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
FifthTuesdayProblemTest.php
Go to the documentation of this file.
1 <?php
2 
4 
8 
9 class FifthTuesdayProblemTest extends TestCase {
10 
17  function testGetDTEnd() {
18 
19  $ics = <<<ICS
20 BEGIN:VCALENDAR
21 VERSION:2.0
22 PRODID:-//Apple Inc.//iCal 4.0.4//EN
23 CALSCALE:GREGORIAN
24 BEGIN:VEVENT
25 TRANSP:OPAQUE
26 DTEND;TZID=America/New_York:20070925T170000
27 UID:uuid
28 DTSTAMP:19700101T000000Z
29 LOCATION:
30 DESCRIPTION:
31 STATUS:CONFIRMED
32 SEQUENCE:18
33 SUMMARY:Stuff
34 DTSTART;TZID=America/New_York:20070925T160000
35 CREATED:20071004T144642Z
36 RRULE:FREQ=MONTHLY;INTERVAL=1;UNTIL=20071030T035959Z;BYDAY=5TU
37 END:VEVENT
38 END:VCALENDAR
39 ICS;
40 
41  $vObject = Reader::read($ics);
42  $it = new Recur\EventIterator($vObject, (string)$vObject->VEVENT->UID);
43 
44  while ($it->valid()) {
45  $it->next();
46  }
47 
48  // If we got here, it means we were successful. The bug that was in the
49  // system before would fail on the 5th tuesday of the month, if the 5th
50  // tuesday did not exist.
51  $this->assertTrue(true);
52 
53  }
54 
55 }
This class is used to determine new for a recurring event, when the next events occur.
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42