14 $this->assertInstanceOf(
'Sabre\DAVACL\Xml\Property\ACL', $acl);
23 $expected =
'<?xml version="1.0"?> 24 <d:root xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" />';
26 $this->assertXmlStringEqualsXmlString($expected,
$xml);
34 'principal' =>
'principals/evert',
35 'privilege' =>
'{DAV:}write',
38 'principal' =>
'principals/foo',
39 'privilege' =>
'{DAV:}read',
44 $acl =
new Acl($privileges);
47 $expected =
'<?xml version="1.0"?> 48 <d:root xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns"> 51 <d:href>/principals/evert/</d:href> 61 <d:href>/principals/foo/</d:href> 72 $this->assertXmlStringEqualsXmlString($expected,
$xml);
80 'principal' =>
'{DAV:}authenticated',
81 'privilege' =>
'{DAV:}write',
84 'principal' =>
'{DAV:}unauthenticated',
85 'privilege' =>
'{DAV:}write',
88 'principal' =>
'{DAV:}all',
89 'privilege' =>
'{DAV:}write',
94 $acl =
new Acl($privileges);
97 $expected =
'<?xml version="1.0"?> 98 <d:root xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns"> 131 $this->assertXmlStringEqualsXmlString($expected,
$xml);
137 $source =
'<?xml version="1.0"?> 138 <d:root xmlns:d="DAV:"> 141 <d:href>/principals/evert/</d:href> 151 <d:href>/principals/foo/</d:href> 163 $reader = new \Sabre\Xml\Reader();
164 $reader->elementMap[
'{DAV:}root'] =
'Sabre\DAVACL\Xml\Property\Acl';
170 $this->assertInstanceOf(
'Sabre\\DAVACL\\Xml\\Property\\Acl',
$result);
174 'principal' =>
'/principals/evert/',
175 'protected' =>
false,
176 'privilege' =>
'{DAV:}write',
179 'principal' =>
'/principals/foo/',
181 'privilege' =>
'{DAV:}read',
185 $this->assertEquals($expected,
$result->getPrivileges());
195 $source =
'<?xml version="1.0"?> 196 <d:root xmlns:d="DAV:"> 208 $reader = new \Sabre\Xml\Reader();
209 $reader->elementMap[
'{DAV:}root'] =
'Sabre\DAVACL\Xml\Property\Acl';
218 $source =
'<?xml version="1.0"?> 219 <d:root xmlns:d="DAV:"> 226 <d:principal><d:authenticated /></d:principal> 235 <d:principal><d:unauthenticated /></d:principal> 243 <d:principal><d:all /></d:principal> 248 $reader = new \Sabre\Xml\Reader();
249 $reader->elementMap[
'{DAV:}root'] =
'Sabre\DAVACL\Xml\Property\Acl';
255 $this->assertInstanceOf(
'Sabre\\DAVACL\\Xml\\Property\\Acl',
$result);
259 'principal' =>
'{DAV:}authenticated',
260 'protected' =>
false,
261 'privilege' =>
'{DAV:}write',
264 'principal' =>
'{DAV:}unauthenticated',
265 'protected' =>
false,
266 'privilege' =>
'{DAV:}write',
269 'principal' =>
'{DAV:}all',
270 'protected' =>
false,
271 'privilege' =>
'{DAV:}write',
275 $this->assertEquals($expected,
$result->getPrivileges());
284 $source =
'<?xml version="1.0"?> 285 <d:root xmlns:d="DAV:"> 293 <d:principal><d:href>/principals/evert</d:href></d:principal> 298 $reader = new \Sabre\Xml\Reader();
299 $reader->elementMap[
'{DAV:}root'] =
'Sabre\DAVACL\Xml\Property\Acl';
310 'principal' =>
'principals/evert',
311 'privilege' =>
'{DAV:}write',
314 'principal' =>
'principals/foo',
315 'privilege' =>
'{http://example.org/ns}read',
319 'principal' =>
'{DAV:}authenticated',
320 'privilege' =>
'{DAV:}write',
324 $acl =
new Acl($privileges);
332 '<tr><th>Principal</th><th>Privilege</th><th></th></tr>' .
333 '<tr><td><a href="/base/principals/evert">/base/principals/evert</a></td><td><span title="{DAV:}write">d:write</span></td><td></td></tr>' .
334 '<tr><td><a href="/base/principals/foo">/base/principals/foo</a></td><td><span title="{http://example.org/ns}read">{http://example.org/ns}read</span></td><td>(protected)</td></tr>' .
335 '<tr><td><span title="{DAV:}authenticated">d:authenticated</span></td><td><span title="{DAV:}write">d:write</span></td><td></td></tr>' .
338 $this->assertEquals($expected, $acl->toHtml(
$html));
testSerializeSpecialPrincipals()
testUnserializeDeny()
Sabre
testUnserializeOtherPrincipal()
This class represents the {DAV:}acl property.
This class provides a few utility functions for easily generating HTML for the browser plugin...
testUnserializeNoPrincipal()
Sabre