+
+ function testNotificationProperties() {
+
+ $request = array(
+ '{' . Sabre_CalDAV_Plugin::NS_CALENDARSERVER . '}notificationtype',
+ );
+ $result = array();
+ $notification = new Sabre_CalDAV_Notifications_Node(
+ $this->caldavBackend,
+ new Sabre_CalDAV_Notifications_Notification_SystemStatus('foo')
+ );
+ $this->plugin->beforeGetProperties('foo', $notification, $request, $result);
+
+ $this->assertEquals(
+ array(
+ 200 => array(
+ '{' . Sabre_CalDAV_Plugin::NS_CALENDARSERVER . '}notificationtype' => $notification->getNotificationType()
+ )
+ ), $result);
+
+ }
+
+ function testNotificationGet() {
+
+ $notification = new Sabre_CalDAV_Notifications_Node(
+ $this->caldavBackend,
+ new Sabre_CalDAV_Notifications_Notification_SystemStatus('foo')
+ );
+
+ $server = new Sabre_DAV_Server(array($notification));
+ $caldav = new Sabre_CalDAV_Plugin();
+
+ $httpResponse = new Sabre_HTTP_ResponseMock();
+ $server->httpResponse = $httpResponse;
+
+ $server->addPlugin($caldav);
+
+ $caldav->beforeMethod('GET','foo');
+
+ $this->assertEquals('HTTP/1.1 200 OK', $httpResponse->status);
+ $this->assertEquals(array(
+ 'Content-Type' => 'application/xml',
+ ), $httpResponse->headers);
+
+ $expected =
+'<?xml version="1.0" encoding="UTF-8"?>
+<cs:notification xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/">
+ <cs:systemstatus type="high"/>
+</cs:notification>
+';
+
+ $this->assertEquals($expected, $httpResponse->body);
+
+
+ }
+