4 * This unittest is created to check for an endless loop in Sabre_CalDAV_CalendarQueryValidator
7 * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
8 * @author Evert Pot (http://www.rooftopsolutions.nl/)
9 * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
11 class Sabre_CalDAV_Issue211Test extends Sabre_DAVServerTest {
13 protected $setupCalDAV = true;
15 protected $caldavCalendars = array(
19 'principaluri' => 'principals/user1',
24 protected $caldavCalendarObjects = array(
27 'calendardata' => 'BEGIN:VCALENDAR
30 UID:20120418T172519CEST-3510gh1hVw
31 DTSTAMP:20120418T152519Z
32 DTSTART;VALUE=DATE:20120330
33 DTEND;VALUE=DATE:20120531
34 EXDATE;TZID=Europe/Berlin:20120330T000000
35 RRULE:FREQ=YEARLY;INTERVAL=1
41 ATTENDEE:MAILTO:xxx@domain.de
42 DESCRIPTION:Dies ist eine Kalender Erinnerung
43 SUMMARY:Kalender Alarm Erinnerung
44 TRIGGER;VALUE=DATE-TIME:20120329T060000Z
53 function testIssue211() {
55 $request = new Sabre_HTTP_Request(array(
56 'REQUEST_METHOD' => 'REPORT',
57 'HTTP_CONTENT_TYPE' => 'application/xml',
58 'REQUEST_URI' => '/calendars/user1/calendar1',
62 $request->setBody('<?xml version="1.0" encoding="utf-8" ?>
63 <C:calendar-query xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
69 <C:comp-filter name="VCALENDAR">
70 <C:comp-filter name="VEVENT">
71 <C:comp-filter name="VALARM">
72 <C:time-range start="20120426T220000Z" end="20120427T215959Z"/>
77 </C:calendar-query>');
79 $response = $this->request($request);
81 // if this assert is reached, the endless loop is gone
82 // There should be no matching events
83 $this->assertFalse(strpos('BEGIN:VEVENT', $response->body));