19 <A:mkcol xmlns:A=
"DAV:">
22 <
B:subscribed-strip-attachments xmlns:
B=
"http://calendarserver.org/ns/" />
23 <
B:subscribed-strip-todos xmlns:
B=
"http://calendarserver.org/ns/" />
26 <
B:subscribed xmlns:
B=
"http://calendarserver.org/ns/" />
28 <E:calendar-
color xmlns:E=
"http://apple.com/ns/ical/">#1C4587FF</E:calendar-
color>
29 <A:displayname>Jewish holidays</A:displayname>
30 <
C:calendar-description xmlns:
C=
"urn:ietf:params:xml:ns:caldav">Foo</
C:calendar-description>
31 <E:calendar-order xmlns:E=
"http://apple.com/ns/ical/">19</E:calendar-order>
32 <
B:source xmlns:
B=
"http://calendarserver.org/ns/">
35 <E:refreshrate xmlns:E=
"http://apple.com/ns/ical/">P1W</E:refreshrate>
36 <
B:subscribed-strip-alarms xmlns:
B=
"http://calendarserver.org/ns/" />
43 'Content-Type' =>
'application/xml',
45 $request =
new Request(
'MKCOL',
'/calendars/user1/subscription1', $headers, $body);
48 $this->assertEquals(201,
$response->getStatus());
49 $subscriptions = $this->caldavBackend->getSubscriptionsForUser(
'principals/user1');
60 <
B:mkcalendar xmlns:
B=
"urn:ietf:params:xml:ns:caldav">
61 <A:
set xmlns:A=
"DAV:">
63 <
B:supported-calendar-component-
set>
64 <
B:comp name=
"VEVENT" />
65 </
B:supported-calendar-component-
set>
66 <
C:subscribed-strip-alarms xmlns:
C=
"http://calendarserver.org/ns/" />
67 <
C:subscribed-strip-attachments xmlns:
C=
"http://calendarserver.org/ns/" />
70 <
C:subscribed xmlns:
C=
"http://calendarserver.org/ns/" />
72 <
D:refreshrate xmlns:
D=
"http://apple.com/ns/ical/">P1W</
D:refreshrate>
73 <
C:source xmlns:
C=
"http://calendarserver.org/ns/">
76 <
D:calendar-
color xmlns:
D=
"http://apple.com/ns/ical/">#1C4587FF</
D:calendar-
color>
77 <
D:calendar-order xmlns:
D=
"http://apple.com/ns/ical/">19</
D:calendar-order>
78 <
B:calendar-description>Foo</
B:calendar-description>
79 <
C:subscribed-strip-todos xmlns:
C=
"http://calendarserver.org/ns/" />
80 <A:displayname>Jewish holidays</A:displayname>
87 'Content-Type' =>
'application/xml',
89 $request =
new Request(
'MKCALENDAR',
'/calendars/user1/subscription1', $headers, $body);
92 $this->assertEquals(201,
$response->getStatus());
93 $subscriptions = $this->caldavBackend->getSubscriptionsForUser(
'principals/user1');
98 '{http://calendarserver.org/ns/}subscribed-strip-alarms' =>
'',
100 $this->server->getProperties(
'calendars/user1/subscription1', [
'{http://calendarserver.org/ns/}subscribed-strip-alarms'])
108 $this->assertEquals(
'', $subscription[
'{http://calendarserver.org/ns/}subscribed-strip-attachments']);
109 $this->assertEquals(
'', $subscription[
'{http://calendarserver.org/ns/}subscribed-strip-todos']);
110 $this->assertEquals(
'#1C4587FF', $subscription[
'{http://apple.com/ns/ical/}calendar-color']);
111 $this->assertEquals(
'Jewish holidays', $subscription[
'{DAV:}displayname']);
112 $this->assertEquals(
'Foo', $subscription[
'{urn:ietf:params:xml:ns:caldav}calendar-description']);
113 $this->assertEquals(
'19', $subscription[
'{http://apple.com/ns/ical/}calendar-order']);
114 $this->assertEquals(
'webcal://www.example.org/', $subscription[
'{http://calendarserver.org/ns/}source']->getHref());
115 $this->assertEquals(
'P1W', $subscription[
'{http://apple.com/ns/ical/}refreshrate']);
116 $this->assertEquals(
'subscription1', $subscription[
'uri']);
117 $this->assertEquals(
'principals/user1', $subscription[
'principaluri']);
118 $this->assertEquals(
'webcal://www.example.org/', $subscription[
'source']);
119 $this->assertEquals([
'principals/user1', 1], $subscription[
'id']);
foreach($paths as $path) $request
The Request class represents a single HTTP request.
if(PHP_SAPI !='cli') color
testMKCOL()
OS X 10.7 - 10.9.1.
assertSubscription($subscription)
This class may be used as a basis for other webdav-related unittests.
testMKCALENDAR()
OS X 10.9.2 and up.
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
$setupCalDAVSubscriptions