16 $this->caldavBackend->createCalendar(
23 $this->principalBackend->addPrincipal([
24 'uri' =>
'principals/user1/calendar-proxy-read' 31 $props = $this->server->getPropertiesForPath(
'/principals/user1', [
32 '{urn:ietf:params:xml:ns:caldav}schedule-inbox-URL',
33 '{urn:ietf:params:xml:ns:caldav}schedule-outbox-URL',
34 '{urn:ietf:params:xml:ns:caldav}calendar-user-address-set',
35 '{urn:ietf:params:xml:ns:caldav}calendar-user-type',
36 '{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL',
39 $this->assertArrayHasKey(0, $props);
40 $this->assertArrayHasKey(200, $props[0]);
42 $this->assertArrayHasKey(
'{urn:ietf:params:xml:ns:caldav}schedule-outbox-URL', $props[0][200]);
43 $prop = $props[0][200][
'{urn:ietf:params:xml:ns:caldav}schedule-outbox-URL'];
44 $this->assertTrue($prop instanceof DAV\Xml\
Property\
Href);
45 $this->assertEquals(
'calendars/user1/outbox/', $prop->getHref());
47 $this->assertArrayHasKey(
'{urn:ietf:params:xml:ns:caldav}schedule-inbox-URL', $props[0][200]);
48 $prop = $props[0][200][
'{urn:ietf:params:xml:ns:caldav}schedule-inbox-URL'];
49 $this->assertTrue($prop instanceof DAV\Xml\
Property\Href);
50 $this->assertEquals(
'calendars/user1/inbox/', $prop->getHref());
52 $this->assertArrayHasKey(
'{urn:ietf:params:xml:ns:caldav}calendar-user-address-set', $props[0][200]);
53 $prop = $props[0][200][
'{urn:ietf:params:xml:ns:caldav}calendar-user-address-set'];
54 $this->assertTrue($prop instanceof DAV\Xml\
Property\Href);
55 $this->assertEquals([
'mailto:user1.sabredav@sabredav.org',
'/principals/user1/'], $prop->getHrefs());
57 $this->assertArrayHasKey(
'{urn:ietf:params:xml:ns:caldav}calendar-user-type', $props[0][200]);
58 $prop = $props[0][200][
'{urn:ietf:params:xml:ns:caldav}calendar-user-type'];
59 $this->assertEquals(
'INDIVIDUAL', $prop);
61 $this->assertArrayHasKey(
'{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL', $props[0][200]);
62 $prop = $props[0][200][
'{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL'];
63 $this->assertEquals(
'calendars/user1/default/', $prop->getHref());
68 $props = $this->server->getPropertiesForPath(
'principals/user1/calendar-proxy-read', [
69 '{urn:ietf:params:xml:ns:caldav}schedule-inbox-URL',
70 '{urn:ietf:params:xml:ns:caldav}schedule-outbox-URL',
71 '{urn:ietf:params:xml:ns:caldav}calendar-user-address-set',
72 '{urn:ietf:params:xml:ns:caldav}calendar-user-type',
73 '{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL',
76 $this->assertArrayHasKey(0, $props);
77 $this->assertArrayHasKey(200, $props[0]);
78 $this->assertArrayHasKey(404, $props[0]);
80 $this->assertArrayHasKey(
'{urn:ietf:params:xml:ns:caldav}schedule-outbox-URL', $props[0][404]);
81 $this->assertArrayHasKey(
'{urn:ietf:params:xml:ns:caldav}schedule-inbox-URL', $props[0][404]);
83 $prop = $props[0][200][
'{urn:ietf:params:xml:ns:caldav}calendar-user-address-set'];
84 $this->assertTrue($prop instanceof DAV\Xml\
Property\
Href);
85 $this->assertEquals([
'/principals/user1/calendar-proxy-read/'], $prop->getHrefs());
87 $this->assertArrayHasKey(
'{urn:ietf:params:xml:ns:caldav}calendar-user-type', $props[0][200]);
88 $prop = $props[0][200][
'{urn:ietf:params:xml:ns:caldav}calendar-user-type'];
89 $this->assertEquals(
'INDIVIDUAL', $prop);
91 $this->assertArrayHasKey(
'{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL', $props[0][404]);
96 foreach ($this->caldavBackend->getCalendarsForUser(
'principals/user1') as
$calendar) {
97 $this->caldavBackend->deleteCalendar(
$calendar[
'id']);
99 $props = $this->server->getPropertiesForPath(
'/principals/user1', [
100 '{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL',
103 $this->assertArrayHasKey(0, $props);
104 $this->assertArrayHasKey(404, $props[0]);
106 $this->assertArrayHasKey(
'{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL', $props[0][404]);
116 $path =
'calendars/user1/inbox';
117 $oldProp =
'{http://calendarserver.org/ns/}calendar-availability';
118 $newProp =
'{urn:ietf:params:xml:ns:caldav}calendar-availability';
119 $value1 =
'first value';
120 $value2 =
'second value';
123 $this->server->updateProperties(
$path, [
129 [$newProp => $value1],
130 $this->server->getProperties(
$path, [$newProp])
134 $this->server->updateProperties(
$path, [
140 [$oldProp => $value2],
141 $this->server->getProperties(
$path, [$oldProp])
testPrincipalProperties()
testAvailabilityMapping()
There are two properties for availability.
testPrincipalPropertiesBadPrincipal()
This class may be used as a basis for other webdav-related unittests.