ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
FifthTuesdayProblemTest.php
Go to the documentation of this file.
1<?php
2
4
5use PHPUnit\Framework\TestCase;
8
9class FifthTuesdayProblemTest extends TestCase {
10
17 function testGetDTEnd() {
18
19 $ics = <<<ICS
20BEGIN:VCALENDAR
21VERSION:2.0
22PRODID:-//Apple Inc.//iCal 4.0.4//EN
23CALSCALE:GREGORIAN
24BEGIN:VEVENT
25TRANSP:OPAQUE
26DTEND;TZID=America/New_York:20070925T170000
27UID:uuid
28DTSTAMP:19700101T000000Z
29LOCATION:
30DESCRIPTION:
31STATUS:CONFIRMED
32SEQUENCE:18
33SUMMARY:Stuff
34DTSTART;TZID=America/New_York:20070925T160000
35CREATED:20071004T144642Z
36RRULE:FREQ=MONTHLY;INTERVAL=1;UNTIL=20071030T035959Z;BYDAY=5TU
37END:VEVENT
38END:VCALENDAR
39ICS;
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}
An exception for terminatinating execution or to throw for unit testing.
iCalendar/vCard/jCal/jCard/xCal/xCard reader object.
Definition: Reader.php:15
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42
This class is used to determine new for a recurring event, when the next events occur.