]> git.mxchange.org Git - friendica-addons.git/blob - dav/SabreDAV/tests/Sabre/CalDAV/Issue166Test.php
Move friendica-specific parts into an own subdirectory
[friendica-addons.git] / dav / SabreDAV / tests / Sabre / CalDAV / Issue166Test.php
1 <?php
2
3 class Sabre_CalDAV_Issue166Test extends PHPUnit_Framework_TestCase {
4
5     function testFlaw() {
6
7         $input = <<<HI
8 BEGIN:VCALENDAR
9 PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
10 VERSION:2.0
11 BEGIN:VTIMEZONE
12 TZID:Asia/Pyongyang
13 X-LIC-LOCATION:Asia/Pyongyang
14 BEGIN:STANDARD
15 TZOFFSETFROM:+0900
16 TZOFFSETTO:+0900
17 TZNAME:KST
18 DTSTART:19700101T000000
19 END:STANDARD
20 END:VTIMEZONE
21 BEGIN:VEVENT
22 CREATED:20111118T010857Z
23 LAST-MODIFIED:20111118T010937Z
24 DTSTAMP:20111118T010937Z
25 UID:a03245b3-9947-9a48-a088-863c74e0fdd8
26 SUMMARY:New Event
27 RRULE:FREQ=YEARLY
28 DTSTART;TZID=Asia/Pyongyang:19960102T111500
29 DTEND;TZID=Asia/Pyongyang:19960102T121500
30 END:VEVENT
31 END:VCALENDAR
32 HI;
33
34         $validator = new Sabre_CalDAV_CalendarQueryValidator();
35
36         $filters = array(
37             'name' => 'VCALENDAR',
38             'comp-filters' => array(
39                 array(
40                     'name' => 'VEVENT',
41                     'comp-filters' => array(),
42                     'prop-filters' => array(),
43                     'is-not-defined' => false,
44                     'time-range' => array(
45                         'start' => new DateTime('2011-12-01'),
46                         'end'   => new DateTime('2012-02-01'),
47                     ),
48                 ),
49             ),
50             'prop-filters' => array(),
51             'is-not-defined' => false,
52             'time-range' => null,
53         );
54         $input = Sabre_VObject_Reader::read($input);
55         $this->assertTrue($validator->validate($input,$filters));
56
57     }
58
59 }