Example #1
0
 function testNotificationProperties()
 {
     $request = array('{' . Sabre_CalDAV_Plugin::NS_CALENDARSERVER . '}notificationtype');
     $result = array();
     $notification = new Sabre_CalDAV_Notifications_Node($this->caldavBackend, 'principals/user1', new Sabre_CalDAV_Notifications_Notification_SystemStatus('foo', '"1"'));
     $this->plugin->beforeGetProperties('foo', $notification, $request, $result);
     $this->assertEquals(array(200 => array('{' . Sabre_CalDAV_Plugin::NS_CALENDARSERVER . '}notificationtype' => $notification->getNotificationType())), $result);
 }
    /**
     * @expectedException Sabre_DAV_Exception
     */
    function testFreeBusyReportNoACLPlugin()
    {
        $this->server = new Sabre_DAV_Server();
        $this->plugin = new Sabre_CalDAV_Plugin();
        $this->server->addPlugin($this->plugin);
        $reportXML = <<<XML
<?xml version="1.0"?>
<c:free-busy-query xmlns:c="urn:ietf:params:xml:ns:caldav">
    <c:time-range start="20111001T000000Z" end="20111101T000000Z" />
</c:free-busy-query>
XML;
        $dom = Sabre_DAV_XMLUtil::loadDOMDocument($reportXML);
        $this->plugin->report('{urn:ietf:params:xml:ns:caldav}free-busy-query', $dom);
    }
Example #3
0
 function testSimple()
 {
     $this->assertEquals(array('MKCALENDAR'), $this->plugin->getHTTPMethods('calendars/user1/randomnewcalendar'));
     $this->assertEquals(array('calendar-access', 'calendar-proxy'), $this->plugin->getFeatures());
     $this->assertArrayHasKey('urn:ietf:params:xml:ns:caldav', $this->server->xmlNamespaces);
 }
 /**
  * @depends testParamFilter
  */
 function testUndefinedNegation()
 {
     $calendarPlugin = new Sabre_CalDAV_Plugin(Sabre_CalDAV_Util::getBackend());
     $filters = array('/c:iCalendar/c:vcalendar' => array(), '/c:iCalendar/c:vcalendar/c:vtodo' => array(), '/c:iCalendar/c:vcalendar/c:vtodo/c:completed' => array('is-not-defined' => true), '/c:iCalendar/c:vcalendar/c:vtodo/c:status' => array('text-match' => array('collation' => 'i;ascii-casemap', 'negate-condition' => true, 'value' => 'CANCELLED')));
     $this->assertFalse($calendarPlugin->validateFilters(Sabre_CalDAV_TestUtil::getTestCalendarData(), $filters));
     $this->assertTrue($calendarPlugin->validateFilters(Sabre_CalDAV_TestUtil::getTestTodo(), $filters));
 }