mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-09 18:08:49 +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
131
dav/SabreDAV/tests/Sabre/CalDAV/Issue172Test.php
Normal file
131
dav/SabreDAV/tests/Sabre/CalDAV/Issue172Test.php
Normal file
|
@ -0,0 +1,131 @@
|
|||
<?php
|
||||
|
||||
class Sabre_CalDAV_Issue172Test extends PHPUnit_Framework_TestCase {
|
||||
|
||||
// DateTimeZone() native name: America/Los_Angeles (GMT-8 in January)
|
||||
function testBuiltInTimezoneName() {
|
||||
$input = <<<HI
|
||||
BEGIN:VCALENDAR
|
||||
VERSION:2.0
|
||||
BEGIN:VEVENT
|
||||
DTSTART;TZID=America/Los_Angeles:20120118T204500
|
||||
DTEND;TZID=America/Los_Angeles:20120118T214500
|
||||
END:VEVENT
|
||||
END:VCALENDAR
|
||||
HI;
|
||||
$validator = new Sabre_CalDAV_CalendarQueryValidator();
|
||||
$filters = array(
|
||||
'name' => 'VCALENDAR',
|
||||
'comp-filters' => array(
|
||||
array(
|
||||
'name' => 'VEVENT',
|
||||
'comp-filters' => array(),
|
||||
'prop-filters' => array(),
|
||||
'is-not-defined' => false,
|
||||
'time-range' => array(
|
||||
'start' => new DateTime('2012-01-18 21:00:00 GMT-08:00'),
|
||||
'end' => new DateTime('2012-01-18 21:00:00 GMT-08:00'),
|
||||
),
|
||||
),
|
||||
),
|
||||
'prop-filters' => array(),
|
||||
);
|
||||
$input = Sabre_VObject_Reader::read($input);
|
||||
$this->assertTrue($validator->validate($input,$filters));
|
||||
}
|
||||
|
||||
// Pacific Standard Time, translates to America/Los_Angeles (GMT-8 in January)
|
||||
function testOutlookTimezoneName() {
|
||||
$input = <<<HI
|
||||
BEGIN:VCALENDAR
|
||||
VERSION:2.0
|
||||
BEGIN:VTIMEZONE
|
||||
TZID:Pacific Standard Time
|
||||
BEGIN:STANDARD
|
||||
DTSTART:16010101T030000
|
||||
TZOFFSETFROM:+0200
|
||||
TZOFFSETTO:+0100
|
||||
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
|
||||
END:STANDARD
|
||||
BEGIN:DAYLIGHT
|
||||
DTSTART:16010101T020000
|
||||
TZOFFSETFROM:+0100
|
||||
TZOFFSETTO:+0200
|
||||
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
|
||||
END:DAYLIGHT
|
||||
END:VTIMEZONE
|
||||
BEGIN:VEVENT
|
||||
DTSTART;TZID=Pacific Standard Time:20120113T100000
|
||||
DTEND;TZID=Pacific Standard Time:20120113T110000
|
||||
END:VEVENT
|
||||
END:VCALENDAR
|
||||
HI;
|
||||
$validator = new Sabre_CalDAV_CalendarQueryValidator();
|
||||
$filters = array(
|
||||
'name' => 'VCALENDAR',
|
||||
'comp-filters' => array(
|
||||
array(
|
||||
'name' => 'VEVENT',
|
||||
'comp-filters' => array(),
|
||||
'prop-filters' => array(),
|
||||
'is-not-defined' => false,
|
||||
'time-range' => array(
|
||||
'start' => new DateTime('2012-01-13 10:30:00 GMT-08:00'),
|
||||
'end' => new DateTime('2012-01-13 10:30:00 GMT-08:00'),
|
||||
),
|
||||
),
|
||||
),
|
||||
'prop-filters' => array(),
|
||||
);
|
||||
$input = Sabre_VObject_Reader::read($input);
|
||||
$this->assertTrue($validator->validate($input,$filters));
|
||||
}
|
||||
|
||||
// X-LIC-LOCATION, translates to America/Los_Angeles (GMT-8 in January)
|
||||
function testLibICalLocationName() {
|
||||
$input = <<<HI
|
||||
BEGIN:VCALENDAR
|
||||
VERSION:2.0
|
||||
BEGIN:VTIMEZONE
|
||||
TZID:My own timezone name
|
||||
X-LIC-LOCATION:America/Los_Angeles
|
||||
BEGIN:STANDARD
|
||||
DTSTART:16010101T030000
|
||||
TZOFFSETFROM:+0200
|
||||
TZOFFSETTO:+0100
|
||||
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
|
||||
END:STANDARD
|
||||
BEGIN:DAYLIGHT
|
||||
DTSTART:16010101T020000
|
||||
TZOFFSETFROM:+0100
|
||||
TZOFFSETTO:+0200
|
||||
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
|
||||
END:DAYLIGHT
|
||||
END:VTIMEZONE
|
||||
BEGIN:VEVENT
|
||||
DTSTART;TZID=My own timezone name:20120113T100000
|
||||
DTEND;TZID=My own timezone name:20120113T110000
|
||||
END:VEVENT
|
||||
END:VCALENDAR
|
||||
HI;
|
||||
$validator = new Sabre_CalDAV_CalendarQueryValidator();
|
||||
$filters = array(
|
||||
'name' => 'VCALENDAR',
|
||||
'comp-filters' => array(
|
||||
array(
|
||||
'name' => 'VEVENT',
|
||||
'comp-filters' => array(),
|
||||
'prop-filters' => array(),
|
||||
'is-not-defined' => false,
|
||||
'time-range' => array(
|
||||
'start' => new DateTime('2012-01-13 10:30:00 GMT-08:00'),
|
||||
'end' => new DateTime('2012-01-13 10:30:00 GMT-08:00'),
|
||||
),
|
||||
),
|
||||
),
|
||||
'prop-filters' => array(),
|
||||
);
|
||||
$input = Sabre_VObject_Reader::read($input);
|
||||
$this->assertTrue($validator->validate($input,$filters));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue