コード例 #1
0
 function testNotificationProperties()
 {
     $notification = new Node($this->caldavBackend, 'principals/user1', new Notification\SystemStatus('foo', '"1"'));
     $propFind = new DAV\PropFind('calendars/user1/notifications', ['{' . Plugin::NS_CALENDARSERVER . '}notificationtype']);
     $this->plugin->propFind($propFind, $notification);
     $this->assertEquals($notification->getNotificationType(), $propFind->get('{' . Plugin::NS_CALENDARSERVER . '}notificationtype'));
 }
コード例 #2
0
ファイル: PluginTest.php プロジェクト: samj1912/repo
 function testNotificationProperties()
 {
     $request = array('{' . Plugin::NS_CALENDARSERVER . '}notificationtype');
     $result = array();
     $notification = new Notifications\Node($this->caldavBackend, 'principals/user1', new Notifications\Notification\SystemStatus('foo', '"1"'));
     $this->plugin->beforeGetProperties('foo', $notification, $request, $result);
     $this->assertEquals(array(200 => array('{' . Plugin::NS_CALENDARSERVER . '}notificationtype' => $notification->getNotificationType())), $result);
 }
コード例 #3
0
    /**
     * @expectedException Sabre\DAV\Exception
     */
    function testFreeBusyReportNoACLPlugin()
    {
        $this->server = new DAV\Server();
        $this->plugin = new 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;
        $report = $this->server->xml->parse($reportXML, null, $rootElem);
        $this->plugin->report($rootElem, $report);
    }
コード例 #4
0
    /**
     * @expectedException Sabre\DAV\Exception
     */
    function testFreeBusyReportNoACLPlugin()
    {
        $this->server = new DAV\Server();
        $this->plugin = new 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 = DAV\XMLUtil::loadDOMDocument($reportXML);
        $this->plugin->report('{urn:ietf:params:xml:ns:caldav}free-busy-query', $dom);
    }
コード例 #5
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);
 }