ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\CalDAV\ExpandEventsDoubleEventsTest Class Reference

This unittests is created to find out why certain events show up twice. More...

+ Inheritance diagram for Sabre\CalDAV\ExpandEventsDoubleEventsTest:
+ Collaboration diagram for Sabre\CalDAV\ExpandEventsDoubleEventsTest:

Public Member Functions

 testExpand ()
 
- Public Member Functions inherited from Sabre\DAVServerTest
 setUp ()
 
 initializeEverything ()
 
 request ($request, $expectedStatus=null)
 Makes a request, and returns a response object. More...
 
 autoLogin ($userName)
 This function takes a username and sets the server in a state where this user is logged in, and no longer requires an authentication check. More...
 
 setUpTree ()
 Override this to provide your own Tree for your test-case. More...
 
 setUpBackends ()
 
 assertHttpStatus ($expectedStatus, HTTP\Request $req)
 

Protected Attributes

 $setupCalDAV = true
 
 $caldavCalendars
 
 $caldavCalendarObjects
 
- Protected Attributes inherited from Sabre\DAVServerTest
 $setupCalDAV = false
 
 $setupCardDAV = false
 
 $setupACL = false
 
 $setupCalDAVSharing = false
 
 $setupCalDAVScheduling = false
 
 $setupCalDAVSubscriptions = false
 
 $setupCalDAVICSExport = false
 
 $setupLocks = false
 
 $setupFiles = false
 
 $setupSharing = false
 
 $setupPropertyStorage = false
 
 $caldavCalendars = []
 An array with calendars. More...
 
 $caldavCalendarObjects = []
 
 $carddavAddressBooks = []
 
 $carddavCards = []
 
 $server
 
 $tree = []
 
 $caldavBackend
 
 $carddavBackend
 
 $principalBackend
 
 $locksBackend
 
 $propertyStorageBackend
 
 $caldavPlugin
 
 $carddavPlugin
 
 $aclPlugin
 
 $caldavSharingPlugin
 
 $caldavSchedulePlugin
 
 $authPlugin
 
 $locksPlugin
 
 $sharingPlugin
 
 $propertyStoragePlugin
 
 $autoLogin = null
 If this string is set, we will automatically log in the user with this name. More...
 

Detailed Description

This unittests is created to find out why certain events show up twice.

Hopefully, by the time I'm done with this, I've both found the problem, and fixed it :)

Author
Evert Pot (http://evertpot.com/) http://sabre.io/license/ Modified BSD License

Definition at line 18 of file ExpandEventsDoubleEventsTest.php.

Member Function Documentation

◆ testExpand()

Sabre\CalDAV\ExpandEventsDoubleEventsTest::testExpand ( )

Definition at line 57 of file ExpandEventsDoubleEventsTest.php.

References $request, $response, $start, Sabre\HTTP\Sapi\createFromServerArray(), Sabre\VObject\Reader\read(), and Sabre\DAVServerTest\request().

57  {
58 
60  'REQUEST_METHOD' => 'REPORT',
61  'HTTP_CONTENT_TYPE' => 'application/xml',
62  'REQUEST_URI' => '/calendars/user1/calendar1',
63  'HTTP_DEPTH' => '1',
64  ]);
65 
66  $request->setBody('<?xml version="1.0" encoding="utf-8" ?>
67 <C:calendar-query xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
68  <D:prop>
69  <C:calendar-data>
70  <C:expand start="20120205T230000Z" end="20120212T225959Z"/>
71  </C:calendar-data>
72  <D:getetag/>
73  </D:prop>
74  <C:filter>
75  <C:comp-filter name="VCALENDAR">
76  <C:comp-filter name="VEVENT">
77  <C:time-range start="20120205T230000Z" end="20120212T225959Z"/>
78  </C:comp-filter>
79  </C:comp-filter>
80  </C:filter>
81 </C:calendar-query>');
82 
83  $response = $this->request($request);
84 
85  // Everts super awesome xml parser.
86  $body = substr(
87  $response->body,
88  $start = strpos($response->body, 'BEGIN:VCALENDAR'),
89  strpos($response->body, 'END:VCALENDAR') - $start + 13
90  );
91  $body = str_replace('&#13;', '', $body);
92 
93  $vObject = VObject\Reader::read($body);
94 
95  // We only expect 3 events
96  $this->assertEquals(3, count($vObject->VEVENT), 'We got 6 events instead of 3. Output: ' . $body);
97 
98  // TZID should be gone
99  $this->assertFalse(isset($vObject->VEVENT->DTSTART['TZID']));
100 
101  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
$start
Definition: bench.php:8
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
Definition: Sapi.php:107
$response
+ Here is the call graph for this function:

Field Documentation

◆ $caldavCalendarObjects

Sabre\CalDAV\ExpandEventsDoubleEventsTest::$caldavCalendarObjects
protected
Initial value:
= [
1 => [
'event.ics' => [
'calendardata' => 'BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
UID:foobar
DTEND;TZID=Europe/Berlin:20120207T191500
RRULE:FREQ=DAILY;INTERVAL=1;COUNT=3
SUMMARY:RecurringEvents 3 times
DTSTART;TZID=Europe/Berlin:20120207T181500
END:VEVENT
BEGIN:VEVENT
CREATED:20120207T111900Z
UID:foobar
DTEND;TZID=Europe/Berlin:20120208T191500
SUMMARY:RecurringEvents 3 times OVERWRITTEN
DTSTART;TZID=Europe/Berlin:20120208T181500
RECURRENCE-ID;TZID=Europe/Berlin:20120208T181500
END:VEVENT
END:VCALENDAR
'

Definition at line 31 of file ExpandEventsDoubleEventsTest.php.

◆ $caldavCalendars

Sabre\CalDAV\ExpandEventsDoubleEventsTest::$caldavCalendars
protected
Initial value:
= [
[
'id' => 1,
'name' => 'Calendar'

Definition at line 22 of file ExpandEventsDoubleEventsTest.php.

◆ $setupCalDAV

Sabre\CalDAV\ExpandEventsDoubleEventsTest::$setupCalDAV = true
protected

Definition at line 20 of file ExpandEventsDoubleEventsTest.php.


The documentation for this class was generated from the following file: