ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\CalDAV\TestUtil Class Reference
+ Collaboration diagram for Sabre\CalDAV\TestUtil:

Static Public Member Functions

static getBackend ()
 
static getTestCalendarData ($type=1)
 
static getTestTODO ($type='due')
 

Detailed Description

Definition at line 5 of file TestUtil.php.

Member Function Documentation

◆ getBackend()

static Sabre\CalDAV\TestUtil::getBackend ( )
static

Definition at line 7 of file TestUtil.php.

7 {
8
9 $backend = new Backend\Mock();
10 $calendarId = $backend->createCalendar(
11 'principals/user1',
12 'UUID-123467',
13 [
14 '{DAV:}displayname' => 'user1 calendar',
15 '{urn:ietf:params:xml:ns:caldav}calendar-description' => 'Calendar description',
16 '{http://apple.com/ns/ical/}calendar-order' => '1',
17 '{http://apple.com/ns/ical/}calendar-color' => '#FF0000',
18 ]
19 );
20 $backend->createCalendar(
21 'principals/user1',
22 'UUID-123468',
23 [
24 '{DAV:}displayname' => 'user1 calendar2',
25 '{urn:ietf:params:xml:ns:caldav}calendar-description' => 'Calendar description',
26 '{http://apple.com/ns/ical/}calendar-order' => '1',
27 '{http://apple.com/ns/ical/}calendar-color' => '#FF0000',
28 ]
29 );
30 $backend->createCalendarObject($calendarId, 'UUID-2345', self::getTestCalendarData());
31 return $backend;
32
33 }

Referenced by Sabre\CalDAV\CalendarHomeTest\setup(), Sabre\CalDAV\CalendarObjectTest\setup(), and Sabre\CalDAV\CalendarTest\setup().

+ Here is the caller graph for this function:

◆ getTestCalendarData()

static Sabre\CalDAV\TestUtil::getTestCalendarData (   $type = 1)
static

Definition at line 35 of file TestUtil.php.

35 {
36
37 $calendarData = 'BEGIN:VCALENDAR
38VERSION:2.0
39PRODID:-//Apple Inc.//iCal 4.0.1//EN
40CALSCALE:GREGORIAN
41BEGIN:VTIMEZONE
42TZID:Asia/Seoul
43BEGIN:DAYLIGHT
44TZOFFSETFROM:+0900
45RRULE:FREQ=YEARLY;UNTIL=19880507T150000Z;BYMONTH=5;BYDAY=2SU
46DTSTART:19870510T000000
47TZNAME:GMT+09:00
48TZOFFSETTO:+1000
49END:DAYLIGHT
50BEGIN:STANDARD
51TZOFFSETFROM:+1000
52DTSTART:19881009T000000
53TZNAME:GMT+09:00
54TZOFFSETTO:+0900
55END:STANDARD
56END:VTIMEZONE
57BEGIN:VEVENT
58CREATED:20100225T154229Z
59UID:39A6B5ED-DD51-4AFE-A683-C35EE3749627
60TRANSP:TRANSPARENT
61SUMMARY:Something here
62DTSTAMP:20100228T130202Z';
63
64 switch ($type) {
65 case 1 :
66 $calendarData .= "\nDTSTART;TZID=Asia/Seoul:20100223T060000\nDTEND;TZID=Asia/Seoul:20100223T070000\n";
67 break;
68 case 2 :
69 $calendarData .= "\nDTSTART:20100223T060000\nDTEND:20100223T070000\n";
70 break;
71 case 3 :
72 $calendarData .= "\nDTSTART;VALUE=DATE:20100223\nDTEND;VALUE=DATE:20100223\n";
73 break;
74 case 4 :
75 $calendarData .= "\nDTSTART;TZID=Asia/Seoul:20100223T060000\nDURATION:PT1H\n";
76 break;
77 case 5 :
78 $calendarData .= "\nDTSTART;TZID=Asia/Seoul:20100223T060000\nDURATION:-P5D\n";
79 break;
80 case 6 :
81 $calendarData .= "\nDTSTART;VALUE=DATE:20100223\n";
82 break;
83 case 7 :
84 $calendarData .= "\nDTSTART;VALUE=DATETIME:20100223T060000\n";
85 break;
86
87 // No DTSTART, so intentionally broken
88 case 'X' :
89 $calendarData .= "\n";
90 break;
91 }
92
93
94 $calendarData .= 'ATTENDEE;PARTSTAT=NEEDS-ACTION:mailto:lisa@example.com
95SEQUENCE:2
96END:VEVENT
97END:VCALENDAR';
98
99 return $calendarData;
100
101 }
$type

References $type.

Referenced by Sabre\CalDAV\PluginTest\setup(), Sabre\CalDAV\PluginTest\testCalendarMultiGetReport(), Sabre\CalDAV\PluginTest\testCalendarMultiGetReportExpand(), Sabre\CalDAV\PluginTest\testCalendarQueryReport(), Sabre\CalDAV\PluginTest\testCalendarQueryReport1Object(), Sabre\CalDAV\PluginTest\testCalendarQueryReportWindowsPhone(), Sabre\CalDAV\CalendarTest\testCreateFile(), Sabre\CalDAV\CalendarTest\testCreateFileNoSupportedComponents(), Sabre\CalDAV\CalendarObjectTest\testPut(), and Sabre\CalDAV\CalendarObjectTest\testPutStream().

+ Here is the caller graph for this function:

◆ getTestTODO()

static Sabre\CalDAV\TestUtil::getTestTODO (   $type = 'due')
static

Definition at line 103 of file TestUtil.php.

103 {
104
105 switch ($type) {
106
107 case 'due' :
108 $extra = "DUE:20100104T000000Z";
109 break;
110 case 'due2' :
111 $extra = "DUE:20060104T000000Z";
112 break;
113 case 'due_date' :
114 $extra = "DUE;VALUE=DATE:20060104";
115 break;
116 case 'due_tz' :
117 $extra = "DUE;TZID=Asia/Seoul:20060104T000000Z";
118 break;
119 case 'due_dtstart' :
120 $extra = "DTSTART:20050223T060000Z\nDUE:20060104T000000Z";
121 break;
122 case 'due_dtstart2' :
123 $extra = "DTSTART:20090223T060000Z\nDUE:20100104T000000Z";
124 break;
125 case 'dtstart' :
126 $extra = 'DTSTART:20100223T060000Z';
127 break;
128 case 'dtstart2' :
129 $extra = 'DTSTART:20060223T060000Z';
130 break;
131 case 'dtstart_date' :
132 $extra = 'DTSTART;VALUE=DATE:20100223';
133 break;
134 case 'dtstart_tz' :
135 $extra = 'DTSTART;TZID=Asia/Seoul:20100223T060000Z';
136 break;
137 case 'dtstart_duration' :
138 $extra = "DTSTART:20061023T060000Z\nDURATION:PT1H";
139 break;
140 case 'dtstart_duration2' :
141 $extra = "DTSTART:20101023T060000Z\nDURATION:PT1H";
142 break;
143 case 'completed' :
144 $extra = 'COMPLETED:20060601T000000Z';
145 break;
146 case 'completed2' :
147 $extra = 'COMPLETED:20090601T000000Z';
148 break;
149 case 'created' :
150 $extra = 'CREATED:20060601T000000Z';
151 break;
152 case 'created2' :
153 $extra = 'CREATED:20090601T000000Z';
154 break;
155 case 'completedcreated' :
156 $extra = "CREATED:20060601T000000Z\nCOMPLETED:20070101T000000Z";
157 break;
158 case 'completedcreated2' :
159 $extra = "CREATED:20090601T000000Z\nCOMPLETED:20100101T000000Z";
160 break;
161 case 'notime' :
162 $extra = 'X-FILLER:oh hello';
163 break;
164 default :
165 throw new Exception('Unknown type: ' . $type);
166
167 }
168
169 $todo = 'BEGIN:VCALENDAR
170VERSION:2.0
171PRODID:-//Example Corp.//CalDAV Client//EN
172BEGIN:VTODO
173DTSTAMP:20060205T235335Z
174' . $extra . '
175STATUS:NEEDS-ACTION
176SUMMARY:Task #1
177UID:DDDEEB7915FA61233B861457@example.com
178BEGIN:VALARM
179ACTION:AUDIO
180TRIGGER;RELATED=START:-PT10M
181END:VALARM
182END:VTODO
183END:VCALENDAR';
184
185 return $todo;
186
187 }

References $type.


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