1<?php
2
3namespace Sabre\VObject\Recur\EventIterator;
4
5use DateTime;
6use Sabre\VObject\Reader;
7
8class MissingOverriddenTest extends \PHPUnit_Framework_TestCase {
9
10    use \Sabre\VObject\PHPUnitAssertions;
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 = $vcal->expand(new DateTime('2011-01-01'), new DateTime('2015-01-01'));
38
39        $output = <<<ICS
40BEGIN:VCALENDAR
41VERSION:2.0
42BEGIN:VEVENT
43UID:foo
44DTSTART:20130727T120000Z
45DURATION:PT1H
46SUMMARY:A
47RECURRENCE-ID:20130727T120000Z
48END:VEVENT
49BEGIN:VEVENT
50RECURRENCE-ID:20130728T120000Z
51UID:foo
52DTSTART:20140101T120000Z
53DURATION:PT1H
54SUMMARY:B
55END:VEVENT
56END:VCALENDAR
57ICS;
58        $this->assertVObjectEqualsVObject($output, $vcal);
59
60    }
61
62}
63