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

This unittest is created to check if a VALARM TRIGGER of PT0S is supported. More...

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

Public Member Functions

 testIssue205 ()
 
- 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 unittest is created to check if a VALARM TRIGGER of PT0S is supported.

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

Definition at line 15 of file Issue205Test.php.

Member Function Documentation

◆ testIssue205()

Sabre\CalDAV\Issue205Test::testIssue205 ( )

Definition at line 52 of file Issue205Test.php.

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

52  {
53 
55  'REQUEST_METHOD' => 'REPORT',
56  'HTTP_CONTENT_TYPE' => 'application/xml',
57  'REQUEST_URI' => '/calendars/user1/calendar1',
58  'HTTP_DEPTH' => '1',
59  ]);
60 
61  $request->setBody('<?xml version="1.0" encoding="utf-8" ?>
62 <C:calendar-query xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
63  <D:prop>
64  <C:calendar-data>
65  <C:expand start="20120325T220000Z" end="20120401T215959Z"/>
66  </C:calendar-data>
67  <D:getetag/>
68  </D:prop>
69  <C:filter>
70  <C:comp-filter name="VCALENDAR">
71  <C:comp-filter name="VEVENT">
72  <C:comp-filter name="VALARM">
73  <C:time-range start="20120325T220000Z" end="20120401T215959Z"/>
74  </C:comp-filter>
75  </C:comp-filter>
76  </C:comp-filter>
77  </C:filter>
78 </C:calendar-query>');
79 
80  $response = $this->request($request);
81 
82  $this->assertFalse(strpos($response->body, '<s:exception>Exception</s:exception>'), 'Exception occurred: ' . $response->body);
83  $this->assertFalse(strpos($response->body, 'Unknown or bad format'), 'DateTime unknown format Exception: ' . $response->body);
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  $this->assertEquals(1, count($vObject->VEVENT));
96 
97  }
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\Issue205Test::$caldavCalendarObjects
protected
Initial value:
= [
1 => [
'event.ics' => [
'calendardata' => 'BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
UID:20120330T155305CEST-6585fBUVgV
DTSTAMP:20120330T135305Z
DTSTART;TZID=Europe/Berlin:20120326T155200
DTEND;TZID=Europe/Berlin:20120326T165200
SUMMARY:original summary
TRANSP:OPAQUE
BEGIN:VALARM
ACTION:AUDIO
ATTACH;VALUE=URI:Basso
TRIGGER:PT0S
END:VALARM
END:VEVENT
END:VCALENDAR
'

Definition at line 28 of file Issue205Test.php.

◆ $caldavCalendars

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

Definition at line 19 of file Issue205Test.php.

◆ $setupCalDAV

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

Definition at line 17 of file Issue205Test.php.


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