35 $server->httpRequest =
new HTTP\Request();
36 $body =
'<?xml version="1.0"?>
39 $server->httpRequest->setBody($body);
54 $server->httpRequest =
new HTTP\Request();
55 $server->httpRequest->setUrl(
'/test');
57 $body =
'<?xml version="1.0"?>
60 $server->httpRequest->setBody($body);
64 $this->assertFalse($acl->httpACL(
$server->httpRequest,
$server->httpResponse));
78 $server->httpRequest =
new HTTP\Request(
'ACL',
'/test');
79 $body =
'<?xml version="1.0"?>
82 <d:grant><d:privilege><d:read /></d:privilege></d:grant>
83 <d:principal><d:href>/principals/notfound</d:href></d:principal>
86 $server->httpRequest->setBody($body);
107 $server->httpRequest =
new HTTP\Request(
'ACL',
'/test');
108 $body =
'<?xml version="1.0"?>
109<d:acl xmlns:d="DAV:">
111 <d:grant><d:privilege><d:read /></d:privilege></d:grant>
112 <d:principal><d:href>/principals/notaprincipal</d:href></d:principal>
115 $server->httpRequest->setBody($body);
133 $server->httpRequest =
new HTTP\Request(
'ACL',
'/test');
134 $body =
'<?xml version="1.0"?>
135<d:acl xmlns:d="DAV:">
137 <d:grant><d:privilege><d:bananas /></d:privilege></d:grant>
138 <d:principal><d:href>/principals/notfound</d:href></d:principal>
141 $server->httpRequest->setBody($body);
159 $server->on(
'getSupportedPrivilegeSet',
function($node, &$supportedPrivilegeSet) {
160 $supportedPrivilegeSet[
'{DAV:}foo'] = [
'abstract' =>
true];
162 $server->httpRequest =
new HTTP\Request(
'ACL',
'/test');
163 $body =
'<?xml version="1.0"?>
164<d:acl xmlns:d="DAV:">
166 <d:grant><d:privilege><d:foo /></d:privilege></d:grant>
167 <d:principal><d:href>/principals/foo/</d:href></d:principal>
170 $server->httpRequest->setBody($body);
185 'principal' =>
'principals/notfound',
186 'privilege' =>
'{DAV:}write',
196 $server->httpRequest =
new HTTP\Request(
'ACL',
'/test');
197 $body =
'<?xml version="1.0"?>
198<d:acl xmlns:d="DAV:">
200 <d:grant><d:privilege><d:read /></d:privilege></d:grant>
201 <d:principal><d:href>/principals/notfound</d:href></d:principal>
204 $server->httpRequest->setBody($body);
219 'principal' =>
'principals/notfound',
220 'privilege' =>
'{DAV:}write',
230 $server->httpRequest =
new HTTP\Request(
'ACL',
'/test');
231 $body =
'<?xml version="1.0"?>
232<d:acl xmlns:d="DAV:">
234 <d:grant><d:privilege><d:write /></d:privilege></d:grant>
235 <d:principal><d:href>/principals/foo</d:href></d:principal>
238 $server->httpRequest->setBody($body);
253 'principal' =>
'principals/notfound',
254 'privilege' =>
'{DAV:}write',
264 $server->httpRequest =
new HTTP\Request(
'ACL',
'/test');
265 $body =
'<?xml version="1.0"?>
266<d:acl xmlns:d="DAV:">
268 <d:grant><d:privilege><d:write /></d:privilege></d:grant>
269 <d:principal><d:href>/principals/notfound</d:href></d:principal>
272 $server->httpRequest->setBody($body);
284 'principal' =>
'principals/foo',
285 'privilege' =>
'{DAV:}write',
289 'principal' =>
'principals/bar',
290 'privilege' =>
'{DAV:}read',
303 $server->httpRequest =
new HTTP\Request(
'ACL',
'/test');
304 $body =
'<?xml version="1.0"?>
305<d:acl xmlns:d="DAV:">
307 <d:grant><d:privilege><d:write /></d:privilege></d:grant>
308 <d:principal><d:href>/principals/foo</d:href></d:principal>
312 <d:grant><d:privilege><d:write /></d:privilege></d:grant>
313 <d:principal><d:href>/principals/baz</d:href></d:principal>
316 $server->httpRequest->setBody($body);
321 $this->assertFalse($acl->httpAcl(
$server->httpRequest,
$server->httpResponse));
323 $this->assertEquals([
325 'principal' =>
'principals/foo',
326 'privilege' =>
'{DAV:}write',
330 'principal' =>
'principals/baz',
331 'privilege' =>
'{DAV:}write',
332 'protected' =>
false,
An exception for terminatinating execution or to throw for unit testing.
testUnrecognizedPrincipal()
@expectedException Sabre\DAVACL\Exception\NotRecognizedPrincipal
testUnknownPrivilege()
@expectedException Sabre\DAVACL\Exception\NotSupportedPrivilege
testUpdateProtectedPrivilege2()
@expectedException Sabre\DAVACL\Exception\AceConflict
testAbstractPrivilege()
@expectedException Sabre\DAVACL\Exception\NoAbstract
testCallback()
@expectedException Sabre\DAV\Exception\BadRequest
testNotSupportedByNode()
/** @expectedException Sabre\DAV\Exception\MethodNotAllowed
testUpdateProtectedPrivilege3()
@expectedException Sabre\DAVACL\Exception\AceConflict
testUnrecognizedPrincipal2()
@expectedException Sabre\DAVACL\Exception\NotRecognizedPrincipal
testUpdateProtectedPrivilege()
@expectedException Sabre\DAVACL\Exception\AceConflict