annotate vendor/sabre/vobject/tests/VObject/Recur/EventIterator/MissingOverriddenTest.php @ 7:430dbd5346f7

vendor sabre as distributed
author Charlie Root
date Sat, 13 Jan 2018 09:06:10 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
1 <?php
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
3 namespace Sabre\VObject;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
4
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
5 use
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
6 DateTime,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
7 DateTimeZone;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
8
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
9 class RecurrenceIteratorMissingOverriddenTest extends \PHPUnit_Framework_TestCase {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
10
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
11 function testExpand() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
12
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
13 $input = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
14 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
15 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
16 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
17 UID:foo
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
18 DTSTART:20130727T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
19 DURATION:PT1H
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
20 RRULE:FREQ=DAILY;COUNT=2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
21 SUMMARY:A
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
22 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
23 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
24 RECURRENCE-ID:20130728T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
25 UID:foo
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
26 DTSTART:20140101T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
27 DURATION:PT1H
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
28 SUMMARY:B
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
29 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
30 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
31 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
32
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
33 $vcal = Reader::read($input);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
34 $this->assertInstanceOf('Sabre\\VObject\\Component\\VCalendar', $vcal);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
35
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
36 $vcal->expand(new DateTime('2011-01-01'), new DateTime('2015-01-01'));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
37
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
38 $result = $vcal->serialize();
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
39
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
40 $output = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
41 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
42 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
43 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
44 UID:foo
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
45 DTSTART:20130727T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
46 DURATION:PT1H
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
47 SUMMARY:A
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
48 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
49 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
50 RECURRENCE-ID:20130728T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
51 UID:foo
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
52 DTSTART:20140101T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
53 DURATION:PT1H
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
54 SUMMARY:B
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
55 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
56 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
57
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
58 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
59 $this->assertEquals($output, str_replace("\r","",$result));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
60
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
61 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
62
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
63 }