ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
IncorrectExpandTest.php
Go to the documentation of this file.
1<?php
2
4
5use DateTime;
6use PHPUnit\Framework\TestCase;
8
12class IncorrectExpandTest extends TestCase {
13
14 use \Sabre\VObject\PHPUnitAssertions;
15
16 function testExpand() {
17
18 $input = <<<ICS
19BEGIN:VCALENDAR
20VERSION:2.0
21BEGIN:VEVENT
22UID:foo
23DTSTART:20130711T050000Z
24DTEND:20130711T053000Z
25RRULE:FREQ=DAILY;INTERVAL=1;COUNT=2
26END:VEVENT
27BEGIN:VEVENT
28UID:foo
29DTSTART:20130719T050000Z
30DTEND:20130719T053000Z
31RECURRENCE-ID:20130712T050000Z
32END:VEVENT
33END:VCALENDAR
34ICS;
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
42BEGIN:VCALENDAR
43VERSION:2.0
44BEGIN:VEVENT
45UID:foo
46DTSTART:20130711T050000Z
47DTEND:20130711T053000Z
48RECURRENCE-ID:20130711T050000Z
49END:VEVENT
50BEGIN:VEVENT
51UID:foo
52DTSTART:20130719T050000Z
53DTEND:20130719T053000Z
54RECURRENCE-ID:20130712T050000Z
55END:VEVENT
56END:VCALENDAR
57
58ICS;
59 $this->assertVObjectEqualsVObject($output, $vcal);
60
61 }
62
63}
An exception for terminatinating execution or to throw for unit testing.
iCalendar/vCard/jCal/jCard/xCal/xCard reader object.
Definition: Reader.php:15
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42
foreach($paths as $path) if($argc< 3) $input