ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
IncorrectExpandTest.php
Go to the documentation of this file.
1 <?php
2 
4 
5 use DateTime;
8 
12 class IncorrectExpandTest extends TestCase {
13 
14  use \Sabre\VObject\PHPUnitAssertions;
15 
16  function testExpand() {
17 
18  $input = <<<ICS
19 BEGIN:VCALENDAR
20 VERSION:2.0
21 BEGIN:VEVENT
22 UID:foo
23 DTSTART:20130711T050000Z
24 DTEND:20130711T053000Z
25 RRULE:FREQ=DAILY;INTERVAL=1;COUNT=2
26 END:VEVENT
27 BEGIN:VEVENT
28 UID:foo
29 DTSTART:20130719T050000Z
30 DTEND:20130719T053000Z
31 RECURRENCE-ID:20130712T050000Z
32 END:VEVENT
33 END:VCALENDAR
34 ICS;
35 
37  $this->assertInstanceOf('Sabre\\VObject\\Component\\VCalendar', $vcal);
38 
39  $vcal = $vcal->expand(new DateTime('2011-01-01'), new DateTime('2014-01-01'));
40 
41  $output = <<<ICS
42 BEGIN:VCALENDAR
43 VERSION:2.0
44 BEGIN:VEVENT
45 UID:foo
46 DTSTART:20130711T050000Z
47 DTEND:20130711T053000Z
48 RECURRENCE-ID:20130711T050000Z
49 END:VEVENT
50 BEGIN:VEVENT
51 UID:foo
52 DTSTART:20130719T050000Z
53 DTEND:20130719T053000Z
54 RECURRENCE-ID:20130712T050000Z
55 END:VEVENT
56 END:VCALENDAR
57 
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