ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
BrokerDeleteEventTest.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Sabre\VObject\ITip;
4 
6 
8 
9  $oldMessage = <<<ICS
10 BEGIN:VCALENDAR
11 VERSION:2.0
12 BEGIN:VEVENT
13 UID:foobar
14 SEQUENCE:1
15 SUMMARY:foo
16 ORGANIZER;CN=Strunk:mailto:strunk@example.org
17 ATTENDEE;CN=One:mailto:one@example.org
18 ATTENDEE;CN=Two:mailto:two@example.org
19 DTSTART:20140716T120000Z
20 DTEND:20140716T130000Z
21 END:VEVENT
22 END:VCALENDAR
23 ICS;
24 
25 
26  $newMessage = null;
27 
29 
30  $expected = [
31  [
32  'uid' => 'foobar',
33  'method' => 'CANCEL',
34  'component' => 'VEVENT',
35  'sender' => 'mailto:strunk@example.org',
36  'senderName' => 'Strunk',
37  'recipient' => 'mailto:one@example.org',
38  'recipientName' => 'One',
39  'message' => <<<ICS
40 BEGIN:VCALENDAR
41 VERSION:2.0
42 PRODID:-//Sabre//Sabre VObject $version//EN
43 CALSCALE:GREGORIAN
44 METHOD:CANCEL
45 BEGIN:VEVENT
46 UID:foobar
47 DTSTAMP:**ANY**
48 SEQUENCE:2
49 SUMMARY:foo
50 DTSTART:20140716T120000Z
51 DTEND:20140716T130000Z
52 ORGANIZER;CN=Strunk:mailto:strunk@example.org
53 ATTENDEE;CN=One:mailto:one@example.org
54 END:VEVENT
55 END:VCALENDAR
56 ICS
57  ],
58 
59  [
60  'uid' => 'foobar',
61  'method' => 'CANCEL',
62  'component' => 'VEVENT',
63  'sender' => 'mailto:strunk@example.org',
64  'senderName' => 'Strunk',
65  'recipient' => 'mailto:two@example.org',
66  'recipientName' => 'Two',
67  'message' => <<<ICS
68 BEGIN:VCALENDAR
69 VERSION:2.0
70 PRODID:-//Sabre//Sabre VObject $version//EN
71 CALSCALE:GREGORIAN
72 METHOD:CANCEL
73 BEGIN:VEVENT
74 UID:foobar
75 DTSTAMP:**ANY**
76 SEQUENCE:2
77 SUMMARY:foo
78 DTSTART:20140716T120000Z
79 DTEND:20140716T130000Z
80 ORGANIZER;CN=Strunk:mailto:strunk@example.org
81 ATTENDEE;CN=Two:mailto:two@example.org
82 END:VEVENT
83 END:VCALENDAR
84 ICS
85 
86  ],
87  ];
88 
89  $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org');
90 
91  }
92 
94 
95  $oldMessage = <<<ICS
96 BEGIN:VCALENDAR
97 VERSION:2.0
98 BEGIN:VEVENT
99 UID:foobar
100 SEQUENCE:1
101 SUMMARY:foo
102 ORGANIZER;CN=Strunk:mailto:strunk@example.org
103 ATTENDEE;CN=One:mailto:one@example.org
104 ATTENDEE;CN=Two:mailto:two@example.org
105 DTSTART:20140716T120000Z
106 DURATION:PT1H
107 END:VEVENT
108 END:VCALENDAR
109 ICS;
110 
111 
112  $newMessage = null;
113 
115 
116  $expected = [
117  [
118  'uid' => 'foobar',
119  'method' => 'CANCEL',
120  'component' => 'VEVENT',
121  'sender' => 'mailto:strunk@example.org',
122  'senderName' => 'Strunk',
123  'recipient' => 'mailto:one@example.org',
124  'recipientName' => 'One',
125  'message' => <<<ICS
126 BEGIN:VCALENDAR
127 VERSION:2.0
128 PRODID:-//Sabre//Sabre VObject $version//EN
129 CALSCALE:GREGORIAN
130 METHOD:CANCEL
131 BEGIN:VEVENT
132 UID:foobar
133 DTSTAMP:**ANY**
134 SEQUENCE:2
135 SUMMARY:foo
136 DTSTART:20140716T120000Z
137 DURATION:PT1H
138 ORGANIZER;CN=Strunk:mailto:strunk@example.org
139 ATTENDEE;CN=One:mailto:one@example.org
140 END:VEVENT
141 END:VCALENDAR
142 ICS
143  ],
144 
145  [
146  'uid' => 'foobar',
147  'method' => 'CANCEL',
148  'component' => 'VEVENT',
149  'sender' => 'mailto:strunk@example.org',
150  'senderName' => 'Strunk',
151  'recipient' => 'mailto:two@example.org',
152  'recipientName' => 'Two',
153  'message' => <<<ICS
154 BEGIN:VCALENDAR
155 VERSION:2.0
156 PRODID:-//Sabre//Sabre VObject $version//EN
157 CALSCALE:GREGORIAN
158 METHOD:CANCEL
159 BEGIN:VEVENT
160 UID:foobar
161 DTSTAMP:**ANY**
162 SEQUENCE:2
163 SUMMARY:foo
164 DTSTART:20140716T120000Z
165 DURATION:PT1H
166 ORGANIZER;CN=Strunk:mailto:strunk@example.org
167 ATTENDEE;CN=Two:mailto:two@example.org
168 END:VEVENT
169 END:VCALENDAR
170 ICS
171 
172  ],
173  ];
174 
175  $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org');
176 
177  }
178 
180 
181  $oldMessage = <<<ICS
182 BEGIN:VCALENDAR
183 VERSION:2.0
184 BEGIN:VEVENT
185 UID:foobar
186 SEQUENCE:1
187 SUMMARY:foo
188 ORGANIZER;CN=Strunk:mailto:strunk@example.org
189 ATTENDEE;CN=One:mailto:one@example.org
190 ATTENDEE;CN=Two:mailto:two@example.org
191 DTSTART:20140716T120000Z
192 DTEND:20140716T130000Z
193 END:VEVENT
194 END:VCALENDAR
195 ICS;
196 
197 
198  $newMessage = null;
199 
201 
202  $expected = [
203  [
204  'uid' => 'foobar',
205  'method' => 'REPLY',
206  'component' => 'VEVENT',
207  'sender' => 'mailto:one@example.org',
208  'senderName' => 'One',
209  'recipient' => 'mailto:strunk@example.org',
210  'recipientName' => 'Strunk',
211  'message' => <<<ICS
212 BEGIN:VCALENDAR
213 VERSION:2.0
214 PRODID:-//Sabre//Sabre VObject $version//EN
215 CALSCALE:GREGORIAN
216 METHOD:REPLY
217 BEGIN:VEVENT
218 UID:foobar
219 DTSTAMP:**ANY**
220 SEQUENCE:1
221 DTSTART:20140716T120000Z
222 DTEND:20140716T130000Z
223 SUMMARY:foo
224 ORGANIZER;CN=Strunk:mailto:strunk@example.org
225 ATTENDEE;PARTSTAT=DECLINED;CN=One:mailto:one@example.org
226 END:VEVENT
227 END:VCALENDAR
228 ICS
229  ],
230  ];
231 
232  $this->parse($oldMessage, $newMessage, $expected, 'mailto:one@example.org');
233 
234 
235  }
236 
238 
239  $oldMessage = <<<ICS
240 BEGIN:VCALENDAR
241 VERSION:2.0
242 BEGIN:VEVENT
243 UID:foobar
244 SEQUENCE:1
245 SUMMARY:foo
246 ORGANIZER;CN=Strunk:mailto:strunk@example.org
247 ATTENDEE;CN=One:mailto:one@example.org
248 ATTENDEE;CN=Two:mailto:two@example.org
249 DTSTART:20140716T120000Z
250 DURATION:PT1H
251 END:VEVENT
252 END:VCALENDAR
253 ICS;
254 
255 
256  $newMessage = null;
257 
259 
260  $expected = [
261  [
262  'uid' => 'foobar',
263  'method' => 'REPLY',
264  'component' => 'VEVENT',
265  'sender' => 'mailto:one@example.org',
266  'senderName' => 'One',
267  'recipient' => 'mailto:strunk@example.org',
268  'recipientName' => 'Strunk',
269  'message' => <<<ICS
270 BEGIN:VCALENDAR
271 VERSION:2.0
272 PRODID:-//Sabre//Sabre VObject $version//EN
273 CALSCALE:GREGORIAN
274 METHOD:REPLY
275 BEGIN:VEVENT
276 UID:foobar
277 DTSTAMP:**ANY**
278 SEQUENCE:1
279 DTSTART:20140716T120000Z
280 DURATION:PT1H
281 SUMMARY:foo
282 ORGANIZER;CN=Strunk:mailto:strunk@example.org
283 ATTENDEE;PARTSTAT=DECLINED;CN=One:mailto:one@example.org
284 END:VEVENT
285 END:VCALENDAR
286 ICS
287  ],
288  ];
289 
290  $this->parse($oldMessage, $newMessage, $expected, 'mailto:one@example.org');
291 
292 
293  }
294 
296 
297  $oldMessage = <<<ICS
298 BEGIN:VCALENDAR
299 VERSION:2.0
300 BEGIN:VEVENT
301 STATUS:CANCELLED
302 UID:foobar
303 SEQUENCE:1
304 ORGANIZER;CN=Strunk:mailto:strunk@example.org
305 ATTENDEE;CN=One:mailto:one@example.org
306 ATTENDEE;CN=Two:mailto:two@example.org
307 DTSTART:20140716T120000Z
308 DTEND:20140716T130000Z
309 END:VEVENT
310 END:VCALENDAR
311 ICS;
312 
313 
314  $newMessage = null;
315 
316  $expected = [];
317 
318  $this->parse($oldMessage, $newMessage, $expected, 'mailto:one@example.org');
319 
320 
321  }
322 
323  function testNoCalendar() {
324 
325  $this->parse(null, null, [], 'mailto:one@example.org');
326 
327  }
328 
329  function testVTodo() {
330 
331  $oldMessage = <<<ICS
332 BEGIN:VCALENDAR
333 VERSION:2.0
334 BEGIN:VTODO
335 UID:foobar
336 SEQUENCE:1
337 END:VTODO
338 END:VCALENDAR
339 ICS;
340  $this->parse($oldMessage, null, [], 'mailto:one@example.org');
341 
342  }
343 
344 }
const VERSION
Full version number.
Definition: Version.php:17
$version
Definition: build.php:27
parse($oldMessage, $newMessage, $expected=[], $currentUser='mailto:one @example.org')
Utilities for testing the broker.