1<?php
2
3namespace Sabre\VObject\Recur\EventIterator;
4
5use
6    DateTime,
7    DateTimeZone,
8    Sabre\VObject\Reader;
9
10class RecurrenceIteratorMissingOverriddenTest extends \PHPUnit_Framework_TestCase {
11
12    function testExpand() {
13
14        $input = <<<ICS
15BEGIN:VCALENDAR
16VERSION:2.0
17BEGIN:VEVENT
18UID:foo
19DTSTART:20130727T120000Z
20DURATION:PT1H
21RRULE:FREQ=DAILY;COUNT=2
22SUMMARY:A
23END:VEVENT
24BEGIN:VEVENT
25RECURRENCE-ID:20130728T120000Z
26UID:foo
27DTSTART:20140101T120000Z
28DURATION:PT1H
29SUMMARY:B
30END:VEVENT
31END:VCALENDAR
32ICS;
33
34        $vcal = Reader::read($input);
35        $this->assertInstanceOf('Sabre\\VObject\\Component\\VCalendar', $vcal);
36
37        $vcal->expand(new DateTime('2011-01-01'), new DateTime('2015-01-01'));
38
39        $result = $vcal->serialize();
40
41        $output = <<<ICS
42BEGIN:VCALENDAR
43VERSION:2.0
44BEGIN:VEVENT
45UID:foo
46DTSTART:20130727T120000Z
47DURATION:PT1H
48SUMMARY:A
49RECURRENCE-ID:20130727T120000Z
50END:VEVENT
51BEGIN:VEVENT
52RECURRENCE-ID:20130728T120000Z
53UID:foo
54DTSTART:20140101T120000Z
55DURATION:PT1H
56SUMMARY:B
57END:VEVENT
58END:VCALENDAR
59
60ICS;
61        $this->assertEquals($output, str_replace("\r","",$result));
62
63    }
64
65}
66