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_Issue220Test extends Sabre_DAVServerTest {
13 protected $setupCalDAV = true;
15 protected $caldavCalendars = array(
19 'principaluri' => 'principals/user1',
24 protected $caldavCalendarObjects = array(
27 'calendardata' => 'BEGIN:VCALENDAR
30 DTSTART;TZID=Europe/Berlin:20120601T180000
32 RRULE:FREQ=DAILY;INTERVAL=1;WKST=MO
35 LAST-MODIFIED:20120601T064634Z
36 CREATED:20120601T064634Z
37 DTSTAMP:20120601T064634Z
38 UID:b64f14c5-dccc-4eda-947f-bdb1f763fbcd
40 TRIGGER;VALUE=DURATION:-PT5M
42 DESCRIPTION:Default Event Notification
43 X-WR-ALARMUID:cd952c1b-b3d6-41fb-b0a6-ec3a1a5bdd58
47 DTSTART;TZID=Europe/Berlin:20120606T180000
51 DTEND;TZID=Europe/Berlin:20120606T182000
52 LAST-MODIFIED:20120605T094310Z
54 RECURRENCE-ID:20120606T160000Z
55 UID:b64f14c5-dccc-4eda-947f-bdb1f763fbcd
63 function testIssue220() {
65 $request = new Sabre_HTTP_Request(array(
66 'REQUEST_METHOD' => 'REPORT',
67 'HTTP_CONTENT_TYPE' => 'application/xml',
68 'REQUEST_URI' => '/calendars/user1/calendar1',
72 $request->setBody('<?xml version="1.0" encoding="utf-8" ?>
73 <C:calendar-query xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
79 <C:comp-filter name="VCALENDAR">
80 <C:comp-filter name="VEVENT">
81 <C:comp-filter name="VALARM">
82 <C:time-range start="20120607T161646Z" end="20120612T161646Z"/>
87 </C:calendar-query>');
89 $response = $this->request($request);
91 $this->assertFalse(strpos($response->body, '<s:exception>PHPUnit_Framework_Error_Warning</s:exception>'), 'Error Warning occurred: ' . $response->body);
92 $this->assertFalse(strpos($response->body, 'Invalid argument supplied for foreach()'), 'Invalid argument supplied for foreach(): ' . $response->body);
94 $this->assertEquals('HTTP/1.1 207 Multi-Status', $response->status);