ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
MissingOverriddenTest.php
Go to the documentation of this file.
1 <?php
2 
4 
5 use DateTime;
8 
9 class MissingOverriddenTest extends TestCase {
10 
11  use \Sabre\VObject\PHPUnitAssertions;
12 
13  function testExpand() {
14 
15  $input = <<<ICS
16 BEGIN:VCALENDAR
17 VERSION:2.0
18 BEGIN:VEVENT
19 UID:foo
20 DTSTART:20130727T120000Z
21 DURATION:PT1H
22 RRULE:FREQ=DAILY;COUNT=2
23 SUMMARY:A
24 END:VEVENT
25 BEGIN:VEVENT
26 RECURRENCE-ID:20130728T120000Z
27 UID:foo
28 DTSTART:20140101T120000Z
29 DURATION:PT1H
30 SUMMARY:B
31 END:VEVENT
32 END:VCALENDAR
33 ICS;
34 
36  $this->assertInstanceOf('Sabre\\VObject\\Component\\VCalendar', $vcal);
37 
38  $vcal = $vcal->expand(new DateTime('2011-01-01'), new DateTime('2015-01-01'));
39 
40  $output = <<<ICS
41 BEGIN:VCALENDAR
42 VERSION:2.0
43 BEGIN:VEVENT
44 UID:foo
45 DTSTART:20130727T120000Z
46 DURATION:PT1H
47 SUMMARY:A
48 RECURRENCE-ID:20130727T120000Z
49 END:VEVENT
50 BEGIN:VEVENT
51 RECURRENCE-ID:20130728T120000Z
52 UID:foo
53 DTSTART:20140101T120000Z
54 DURATION:PT1H
55 SUMMARY:B
56 END:VEVENT
57 END:VCALENDAR
58 ICS;
59  $this->assertVObjectEqualsVObject($output, $vcal);
60 
61  }
62 
63 }
if($argc< 3) $input
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42