22 'principaluri' =>
'principals/user1',
24 '{urn:ietf:params:xml:ns:caldav}calendar-timezone' =>
'BEGIN:VCALENDAR
31RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
32DTSTART:19810329T020000
38RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
39DTSTART:19961027T030000
51 'calendardata' =>
'BEGIN:VCALENDAR
55CREATED:20140701T143658Z
56UID:dba46fe8-1631-4d98-a575-97963c364dfe
59SUMMARY:Floating Time event, starting 05:30am Europe/Berlin
60DTSTART:20141108T053000
61DTSTAMP:20140701T143706Z
70 function testExpandCalendarQuery() {
72 $request =
new HTTP\Request(
'REPORT',
'/calendars/user1/calendar1', [
74 'Content-Type' =>
'application/xml',
77 $request->setBody(
'<?xml version="1.0" encoding="utf-8" ?>
78<C:calendar-query xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
81 <C:expand start="20141107T230000Z" end="20141108T225959Z"/>
86 <C:comp-filter name="VCALENDAR">
87 <C:comp-filter name="VEVENT">
88 <C:time-range start="20141107T230000Z" end="20141108T225959Z"/>
102 $body = str_replace(
' ',
'', $body);
107 foreach ($vObject->VEVENT as $vevent) {
109 foreach ($vevent->children() as $child) {
111 if ($child->name ==
'DTSTART') {
113 $this->assertEquals(
'20141108T043000Z', $child->getValue());
114 } elseif ($child->name ==
'DTEND') {
116 $this->assertEquals(
'20141108T063000Z', $child->getValue());
122 function testExpandMultiGet() {
124 $request =
new HTTP\Request(
'REPORT',
'/calendars/user1/calendar1', [
126 'Content-Type' =>
'application/xml',
129 $request->setBody(
'<?xml version="1.0" encoding="utf-8" ?>
130<C:calendar-multiget xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
133 <C:expand start="20141107T230000Z" end="20141108T225959Z"/>
137 <D:href>/calendars/user1/calendar1/event.ics</D:href>
138</C:calendar-multiget>');
142 $this->assertEquals(207,
$response->getStatus());
150 $body = str_replace(
' ',
'', $body);
155 foreach ($vObject->VEVENT as $vevent) {
157 foreach ($vevent->children() as $child) {
159 if ($child->name ==
'DTSTART') {
161 $this->assertEquals($child->getValue(),
'20141108T043000Z');
162 } elseif ($child->name ==
'DTEND') {
164 $this->assertEquals($child->getValue(),
'20141108T063000Z');
170 function testExpandExport() {
172 $request =
new HTTP\Request(
'GET',
'/calendars/user1/calendar1?export&start=1&end=2000000000&expand=1', [
174 'Content-Type' =>
'application/xml',
179 $this->assertEquals(200,
$response->getStatus());
187 $body = str_replace(
' ',
'', $body);
192 foreach ($vObject->VEVENT as $vevent) {
194 foreach ($vevent->children() as $child) {
196 if ($child->name ==
'DTSTART') {
198 $this->assertEquals(
'20141108T043000Z', $child->getValue());
199 } elseif ($child->name ==
'DTEND') {
201 $this->assertEquals(
'20141108T063000Z', $child->getValue());
foreach($paths as $path) $request
An exception for terminatinating execution or to throw for unit testing.
This unittest is created to check if expand() works correctly with floating times (using calendar-tim...
This class may be used as a basis for other webdav-related unittests.
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.