36 $root->addChild($calendars);
37 $root->addChild($principals);
40 $this->server->sapi =
new HTTP\SapiMock();
41 $this->server->debugExceptions =
true;
42 $this->server->setBaseUri(
'/');
43 $this->plugin =
new Plugin();
44 $this->server->addPlugin($this->plugin);
49 $aclPlugin->allowUnauthenticatedAccess =
false;
53 $this->server->addPlugin(
new CalDAV\
Plugin());
62 $this->response =
new HTTP\ResponseMock();
69 $this->assertEquals([], $this->plugin->getFeatures());
70 $this->assertEquals(
'notifications', $this->plugin->getPluginName());
73 $this->plugin->getPluginInfo()[
'name']
80 $httpRequest =
new Request(
'GET',
'/', [
'Host' =>
'sabredav.org']);
81 $this->server->httpRequest = $httpRequest;
83 $props = $this->server->getPropertiesForPath(
'principals/admin', [
87 $this->assertArrayHasKey(0, $props);
88 $this->assertArrayHasKey(200, $props[0]);
92 $this->assertTrue($prop instanceof DAV\Xml\
Property\
Href);
93 $this->assertEquals(
'calendars/admin/notifications/', $prop->getHref());
99 $notification =
new Node(
100 $this->caldavBackend,
104 $propFind =
new DAV\PropFind(
'calendars/user1/notifications', [
108 $this->plugin->propFind($propFind, $notification);
111 $notification->getNotificationType(),
119 $notification =
new Node(
120 $this->caldavBackend,
129 $httpResponse =
new HTTP\ResponseMock();
130 $server->httpResponse = $httpResponse;
136 $this->assertEquals(200, $httpResponse->status);
137 $this->assertEquals([
138 'Content-Type' => [
'application/xml'],
140 ], $httpResponse->getHeaders());
143 '<?xml version="1.0" encoding="UTF-8"?> 144 <cs:notification xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:cs="http://calendarserver.org/ns/"> 145 <cs:systemstatus type="high"/> 149 $this->assertXmlStringEqualsXmlString($expected, $httpResponse->getBodyAsString());
158 $httpResponse =
new HTTP\ResponseMock();
159 $server->httpResponse = $httpResponse;
163 $this->assertNull($caldav->httpGet(
new HTTP\
Request(
'GET',
'/foozz'),
$server->httpResponse));
This node represents a single notification.
This plugin provides Authentication for a WebDAV server.
const NS_CALENDARSERVER
This is the namespace for the proprietary calendarserver extensions.
The Request class represents a single HTTP request.
This class holds all the information about a PROPFIND request.
SystemStatus notification.
testNotificationProperties()
testPrincipalProperties()
This class represents a single HTTP response.