ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
GetEventsByTimerangeTest.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Sabre\CalDAV;
4 
5 use Sabre\HTTP;
6 
15 
16  protected $setupCalDAV = true;
17 
18  protected $caldavCalendars = [
19  [
20  'id' => 1,
21  'name' => 'Calendar',
22  'principaluri' => 'principals/user1',
23  'uri' => 'calendar1',
24  ]
25  ];
26 
27  protected $caldavCalendarObjects = [
28  1 => [
29  'event.ics' => [
30  'calendardata' => 'BEGIN:VCALENDAR
31 VERSION:2.0
32 BEGIN:VEVENT
33 CREATED:20120313T142342Z
34 UID:171EBEFC-C951-499D-B234-7BA7D677B45D
35 DTEND;TZID=Europe/Berlin:20120227T010000
36 TRANSP:OPAQUE
37 SUMMARY:Monday 0h
38 DTSTART;TZID=Europe/Berlin:20120227T000000
39 DTSTAMP:20120313T142416Z
40 SEQUENCE:4
41 END:VEVENT
42 END:VCALENDAR
43 ',
44  ],
45  ],
46  ];
47 
48  function testQueryTimerange() {
49 
50  $request = new HTTP\Request(
51  'REPORT',
52  '/calendars/user1/calendar1',
53  [
54  'Content-Type' => 'application/xml',
55  'Depth' => '1',
56  ]
57  );
58 
59  $request->setBody('<?xml version="1.0" encoding="utf-8" ?>
60 <C:calendar-query xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
61  <D:prop>
62  <C:calendar-data>
63  <C:expand start="20120226T220000Z" end="20120228T225959Z"/>
64  </C:calendar-data>
65  <D:getetag/>
66  </D:prop>
67  <C:filter>
68  <C:comp-filter name="VCALENDAR">
69  <C:comp-filter name="VEVENT">
70  <C:time-range start="20120226T220000Z" end="20120228T225959Z"/>
71  </C:comp-filter>
72  </C:comp-filter>
73  </C:filter>
74 </C:calendar-query>');
75 
76  $response = $this->request($request);
77 
78  $this->assertTrue(strpos($response->body, 'BEGIN:VCALENDAR') !== false);
79 
80  }
81 
82 }
foreach($paths as $path) $request
Definition: asyncclient.php:32
This class may be used as a basis for other webdav-related unittests.
This unittest is created to check if queries for time-range include the start timestamp or not...
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
$response