|
| testExpand () |
| This tests the expansion of dates with DAILY frequency in RRULE with BYMONTH restrictions. More...
|
|
Definition at line 9 of file ByMonthInDailyTest.php.
◆ testExpand()
Sabre\VObject\Recur\ByMonthInDailyTest::testExpand |
( |
| ) |
|
This tests the expansion of dates with DAILY frequency in RRULE with BYMONTH restrictions.
Definition at line 14 of file ByMonthInDailyTest.php.
14 {
15
16 $ics = <<<ICS
17BEGIN:VCALENDAR
18VERSION:2.0
19PRODID:-
20CALSCALE:GREGORIAN
21BEGIN:VEVENT
22TRANSP:OPAQUE
23DTEND:20070925T183000Z
24UID:uuid
25DTSTAMP:19700101T000000Z
26LOCATION:
27DESCRIPTION:
28STATUS:CONFIRMED
29SEQUENCE:18
30SUMMARY:Stuff
31DTSTART:20070925T160000Z
32CREATED:20071004T144642Z
33RRULE:FREQ=DAILY;BYMONTH=9,10;BYDAY=SU
34END:VEVENT
35END:VCALENDAR
36ICS;
37
39 $this->assertInstanceOf(
'Sabre\\VObject\\Component\\VCalendar',
$vcal);
40
41 $vcal =
$vcal->expand(
new DateTime(
'2013-09-28'),
new DateTime(
'2014-09-11'));
42
43 foreach (
$vcal->VEVENT as $event) {
44 $dates[] = $event->DTSTART->getValue();
45 }
46
47 $expectedDates = [
48 "20130929T160000Z",
49 "20131006T160000Z",
50 "20131013T160000Z",
51 "20131020T160000Z",
52 "20131027T160000Z",
53 "20140907T160000Z"
54 ];
55
56 $this->assertEquals($expectedDates, $dates, 'Recursed dates are restricted by month');
57 }
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: