|
| testExpand () |
| Using this iCalendar object, including BYSETPOS=-2 causes the iterator to hang, as reported in ticket #212. More...
|
|
Definition at line 9 of file BySetPosHangTest.php.
◆ testExpand()
Sabre\VObject\Recur\BySetPosHangTest::testExpand |
( |
| ) |
|
Using this iCalendar object, including BYSETPOS=-2 causes the iterator to hang, as reported in ticket #212.
See: https://github.com/fruux/sabre-vobject/issues/212
Definition at line 17 of file BySetPosHangTest.php.
17 {
18
19 $ics = <<<ICS
20BEGIN:VCALENDAR
21VERSION:2.0
22PRODID:-
23CALSCALE:GREGORIAN
24BEGIN:VEVENT
25SUMMARY:Test event 1
26DTSTART;TZID=Europe/Copenhagen:20150101T170000
27RRULE:FREQ=MONTHLY;BYDAY=TH;BYSETPOS=-2
28UID:b4071499-6fe4-418a-83b8-2b8d5ebb38e4
29END:VEVENT
30END:VCALENDAR
31ICS;
32
34 $this->assertInstanceOf(
'Sabre\\VObject\\Component\\VCalendar',
$vcal);
35
36 $vcal =
$vcal->expand(
new DateTime(
'2015-01-01'),
new DateTime(
'2016-01-01'));
37
38 foreach (
$vcal->VEVENT as $event) {
39 $dates[] = $event->DTSTART->getValue();
40 }
41
42 $expectedDates = [
43 "20150101T160000Z",
44 "20150122T160000Z",
45 "20150219T160000Z",
46 "20150319T160000Z",
47 "20150423T150000Z",
48 "20150521T150000Z",
49 "20150618T150000Z",
50 "20150723T150000Z",
51 "20150820T150000Z",
52 "20150917T150000Z",
53 "20151022T150000Z",
54 "20151119T160000Z",
55 "20151224T160000Z",
56 ];
57
58 $this->assertEquals($expectedDates, $dates);
59 }
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
References $vcal, and Sabre\VObject\Reader\read().
The documentation for this class was generated from the following file: