mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-07 17:08:48 +00:00
Initial Release of the calendar plugin
This commit is contained in:
parent
45cc9885fc
commit
7115197a33
561 changed files with 189494 additions and 0 deletions
86
dav/SabreDAV/tests/Sabre/CalDAV/Backend/AbstractTest.php
Normal file
86
dav/SabreDAV/tests/Sabre/CalDAV/Backend/AbstractTest.php
Normal file
|
@ -0,0 +1,86 @@
|
|||
<?php
|
||||
|
||||
class Sabre_CalDAV_Backend_AbstractTest extends PHPUnit_Framework_TestCase {
|
||||
|
||||
function testUpdateCalendar() {
|
||||
|
||||
$abstract = new Sabre_CalDAV_Backend_AbstractMock();
|
||||
$this->assertEquals(false, $abstract->updateCalendar('randomid', array('{DAV:}displayname' => 'anything')));
|
||||
|
||||
}
|
||||
|
||||
function testCalendarQuery() {
|
||||
|
||||
$abstract = new Sabre_CalDAV_Backend_AbstractMock();
|
||||
$filters = array(
|
||||
'name' => 'VCALENDAR',
|
||||
'comp-filters' => array(
|
||||
array(
|
||||
'name' => 'VEVENT',
|
||||
'comp-filters' => array(),
|
||||
'prop-filters' => array(),
|
||||
'is-not-defined' => false,
|
||||
'time-range' => null,
|
||||
),
|
||||
),
|
||||
'prop-filters' => array(),
|
||||
'is-not-defined' => false,
|
||||
'time-range' => null,
|
||||
);
|
||||
|
||||
$this->assertEquals(array(
|
||||
'event1.ics',
|
||||
), $abstract->calendarQuery(1, $filters));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Sabre_CalDAV_Backend_AbstractMock extends Sabre_CalDAV_Backend_Abstract {
|
||||
|
||||
function getCalendarsForUser($principalUri) { }
|
||||
function createCalendar($principalUri,$calendarUri,array $properties) { }
|
||||
function deleteCalendar($calendarId) { }
|
||||
function getCalendarObjects($calendarId) {
|
||||
|
||||
return array(
|
||||
array(
|
||||
'id' => 1,
|
||||
'calendarid' => 1,
|
||||
'uri' => 'event1.ics',
|
||||
),
|
||||
array(
|
||||
'id' => 2,
|
||||
'calendarid' => 1,
|
||||
'uri' => 'task1.ics',
|
||||
),
|
||||
);
|
||||
|
||||
}
|
||||
function getCalendarObject($calendarId,$objectUri) {
|
||||
|
||||
switch($objectUri) {
|
||||
|
||||
case 'event1.ics' :
|
||||
return array(
|
||||
'id' => 1,
|
||||
'calendarid' => 1,
|
||||
'uri' => 'event1.ics',
|
||||
'calendardata' => "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n",
|
||||
);
|
||||
case 'task1.ics' :
|
||||
return array(
|
||||
'id' => 1,
|
||||
'calendarid' => 1,
|
||||
'uri' => 'event1.ics',
|
||||
'calendardata' => "BEGIN:VCALENDAR\r\nBEGIN:VTODO\r\nEND:VTODO\r\nEND:VCALENDAR\r\n",
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
function createCalendarObject($calendarId,$objectUri,$calendarData) { }
|
||||
function updateCalendarObject($calendarId,$objectUri,$calendarData) { }
|
||||
function deleteCalendarObject($calendarId,$objectUri) { }
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue