14 $this->assertTrue($principal instanceof
Principal);
32 $this->assertEquals(
'admin', $principal->getName());
40 $this->assertEquals(
'admin', $principal->getDisplayname());
43 'uri' =>
'principals/admin',
44 '{DAV:}displayname' =>
'Mr. Admin' 46 $this->assertEquals(
'Mr. Admin', $principal->getDisplayname());
54 'uri' =>
'principals/admin',
55 '{DAV:}displayname' =>
'Mr. Admin',
56 '{http://www.example.org/custom}custom' =>
'Custom',
57 '{http://sabredav.org/ns}email-address' =>
'admin@example.org',
62 '{http://www.example.org/custom}custom',
63 '{http://sabredav.org/ns}email-address',
65 $props = $principal->getProperties(
$keys);
67 foreach (
$keys as
$key) $this->assertArrayHasKey($key, $props);
69 $this->assertEquals(
'Mr. Admin', $props[
'{DAV:}displayname']);
71 $this->assertEquals(
'admin@example.org', $props[
'{http://sabredav.org/ns}email-address']);
81 $result = $principal->propPatch($propPatch);
91 $this->assertEquals(
'principals/admin', $principal->getPrincipalUrl());
99 'uri' =>
'principals/admin',
100 '{DAV:}displayname' =>
'Mr. Admin',
101 '{http://www.example.org/custom}custom' =>
'Custom',
102 '{http://sabredav.org/ns}email-address' =>
'admin@example.org',
103 '{DAV:}alternate-URI-set' => [
104 'mailto:admin+1@example.org',
105 'mailto:admin+2@example.org',
106 'mailto:admin@example.org',
111 'mailto:admin+1@example.org',
112 'mailto:admin+2@example.org',
113 'mailto:admin@example.org',
116 $this->assertEquals($expected, $principal->getAlternateUriSet());
123 'uri' =>
'principals/admin',
128 $this->assertEquals($expected, $principal->getAlternateUriSet());
136 $this->assertEquals([], $principal->getGroupMemberSet());
143 $this->assertEquals([], $principal->getGroupMembership());
151 $principal->setGroupMemberSet([
'principals/foo']);
153 $this->assertEquals([
154 'principals/admin' => [
'principals/foo'],
163 $this->assertEquals(
'principals/admin', $principal->getOwner());
171 $this->assertNull($principal->getGroup());
179 $this->assertEquals([
181 'privilege' =>
'{DAV:}all',
182 'principal' =>
'{DAV:}owner',
185 ], $principal->getACL());
196 $principal->setACL([]);
204 $this->assertNull($principal->getSupportedPrivilegeSet());
This class represents a set of properties that are going to be updated.
testGetAlternateUriSetEmpty()
testConstructNoUri()
Sabre
testGetSupportedPrivilegeSet()