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