ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
BrokerUpdateEventTest.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Sabre\VObject\ITip;
4 
6 
7  function testInviteChange() {
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=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
18 ATTENDEE;CN=One:mailto:one@example.org
19 ATTENDEE;CN=Two:mailto:two@example.org
20 DTSTART:20140716T120000Z
21 DTEND:20140716T130000Z
22 END:VEVENT
23 END:VCALENDAR
24 ICS;
25 
26 
27  $newMessage = <<<ICS
28 BEGIN:VCALENDAR
29 VERSION:2.0
30 BEGIN:VEVENT
31 UID:foobar
32 SEQUENCE:2
33 SUMMARY:foo
34 ORGANIZER;CN=Strunk:mailto:strunk@example.org
35 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
36 ATTENDEE;CN=Two:mailto:two@example.org
37 ATTENDEE;CN=Three:mailto:three@example.org
38 DTSTART:20140716T120000Z
39 DTEND:20140716T130000Z
40 END:VEVENT
41 END:VCALENDAR
42 ICS;
43 
45 
46  $expected = [
47  [
48  'uid' => 'foobar',
49  'method' => 'CANCEL',
50  'component' => 'VEVENT',
51  'sender' => 'mailto:strunk@example.org',
52  'senderName' => 'Strunk',
53  'recipient' => 'mailto:one@example.org',
54  'recipientName' => 'One',
55  'significantChange' => true,
56  'message' => <<<ICS
57 BEGIN:VCALENDAR
58 VERSION:2.0
59 PRODID:-//Sabre//Sabre VObject $version//EN
60 CALSCALE:GREGORIAN
61 METHOD:CANCEL
62 BEGIN:VEVENT
63 UID:foobar
64 DTSTAMP:**ANY**
65 SEQUENCE:2
66 SUMMARY:foo
67 DTSTART:20140716T120000Z
68 DTEND:20140716T130000Z
69 ORGANIZER;CN=Strunk:mailto:strunk@example.org
70 ATTENDEE;CN=One:mailto:one@example.org
71 END:VEVENT
72 END:VCALENDAR
73 ICS
74 
75  ],
76  [
77  'uid' => 'foobar',
78  'method' => 'REQUEST',
79  'component' => 'VEVENT',
80  'sender' => 'mailto:strunk@example.org',
81  'senderName' => 'Strunk',
82  'recipient' => 'mailto:two@example.org',
83  'recipientName' => 'Two',
84  'significantChange' => false,
85  'message' => <<<ICS
86 BEGIN:VCALENDAR
87 VERSION:2.0
88 PRODID:-//Sabre//Sabre VObject $version//EN
89 CALSCALE:GREGORIAN
90 METHOD:REQUEST
91 BEGIN:VEVENT
92 UID:foobar
93 SEQUENCE:2
94 SUMMARY:foo
95 ORGANIZER;CN=Strunk:mailto:strunk@example.org
96 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
97 ATTENDEE;CN=Two;PARTSTAT=NEEDS-ACTION:mailto:two@example.org
98 ATTENDEE;CN=Three;PARTSTAT=NEEDS-ACTION:mailto:three@example.org
99 DTSTART:20140716T120000Z
100 DTEND:20140716T130000Z
101 END:VEVENT
102 END:VCALENDAR
103 ICS
104 
105  ],
106  [
107  'uid' => 'foobar',
108  'method' => 'REQUEST',
109  'component' => 'VEVENT',
110  'sender' => 'mailto:strunk@example.org',
111  'senderName' => 'Strunk',
112  'recipient' => 'mailto:three@example.org',
113  'recipientName' => 'Three',
114  'significantChange' => true,
115  'message' => <<<ICS
116 BEGIN:VCALENDAR
117 VERSION:2.0
118 PRODID:-//Sabre//Sabre VObject $version//EN
119 CALSCALE:GREGORIAN
120 METHOD:REQUEST
121 BEGIN:VEVENT
122 UID:foobar
123 SEQUENCE:2
124 SUMMARY:foo
125 ORGANIZER;CN=Strunk:mailto:strunk@example.org
126 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
127 ATTENDEE;CN=Two;PARTSTAT=NEEDS-ACTION:mailto:two@example.org
128 ATTENDEE;CN=Three;PARTSTAT=NEEDS-ACTION:mailto:three@example.org
129 DTSTART:20140716T120000Z
130 DTEND:20140716T130000Z
131 END:VEVENT
132 END:VCALENDAR
133 ICS
134 
135  ],
136  ];
137 
138  $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org');
139 
140  }
141 
143 
144  $oldMessage = <<<ICS
145 BEGIN:VCALENDAR
146 VERSION:2.0
147 BEGIN:VEVENT
148 UID:foobar
149 SEQUENCE:1
150 DTSTART:20140716T120000Z
151 DTEND:20140716T130000Z
152 END:VEVENT
153 END:VCALENDAR
154 ICS;
155 
156 
157  $newMessage = <<<ICS
158 BEGIN:VCALENDAR
159 VERSION:2.0
160 BEGIN:VEVENT
161 UID:foobar
162 SEQUENCE:2
163 ORGANIZER;CN=Strunk:mailto:strunk@example.org
164 ATTENDEE;CN=One:mailto:one@example.org
165 DTSTART:20140716T120000Z
166 DTEND:20140716T130000Z
167 END:VEVENT
168 END:VCALENDAR
169 ICS;
170 
172 
173  $expected = [
174  [
175  'uid' => 'foobar',
176  'method' => 'REQUEST',
177  'component' => 'VEVENT',
178  'sender' => 'mailto:strunk@example.org',
179  'senderName' => 'Strunk',
180  'recipient' => 'mailto:one@example.org',
181  'recipientName' => 'One',
182  'message' => <<<ICS
183 BEGIN:VCALENDAR
184 VERSION:2.0
185 PRODID:-//Sabre//Sabre VObject $version//EN
186 CALSCALE:GREGORIAN
187 METHOD:REQUEST
188 BEGIN:VEVENT
189 UID:foobar
190 SEQUENCE:2
191 ORGANIZER;CN=Strunk:mailto:strunk@example.org
192 ATTENDEE;CN=One;PARTSTAT=NEEDS-ACTION:mailto:one@example.org
193 DTSTART:20140716T120000Z
194 DTEND:20140716T130000Z
195 END:VEVENT
196 END:VCALENDAR
197 ICS
198 
199  ],
200 
201  ];
202 
203  $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org');
204 
205  }
206 
208 
209  $oldMessage = <<<ICS
210 BEGIN:VCALENDAR
211 VERSION:2.0
212 BEGIN:VEVENT
213 UID:foobar
214 SEQUENCE:2
215 ORGANIZER;CN=Strunk:mailto:strunk@example.org
216 ATTENDEE;CN=One:mailto:one@example.org
217 DTSTART:20140716T120000Z
218 DTEND:20140716T130000Z
219 END:VEVENT
220 END:VCALENDAR
221 ICS;
222 
223 
224  $newMessage = <<<ICS
225 BEGIN:VCALENDAR
226 VERSION:2.0
227 BEGIN:VEVENT
228 UID:foobar
229 SEQUENCE:1
230 DTSTART:20140716T120000Z
231 DTEND:20140716T130000Z
232 END:VEVENT
233 END:VCALENDAR
234 ICS;
235 
237 
238  $expected = [
239  [
240  'uid' => 'foobar',
241  'method' => 'CANCEL',
242  'component' => 'VEVENT',
243  'message' => <<<ICS
244 BEGIN:VCALENDAR
245 VERSION:2.0
246 PRODID:-//Sabre//Sabre VObject $version//EN
247 CALSCALE:GREGORIAN
248 METHOD:CANCEL
249 BEGIN:VEVENT
250 UID:foobar
251 DTSTAMP:**ANY**
252 SEQUENCE:1
253 DTSTART:20140716T120000Z
254 DTEND:20140716T130000Z
255 ORGANIZER;CN=Strunk:mailto:strunk@example.org
256 ATTENDEE;CN=One:mailto:one@example.org
257 END:VEVENT
258 END:VCALENDAR
259 ICS
260 
261  ],
262 
263  ];
264 
265  $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org');
266 
267  }
268 
269  function testNoAttendees() {
270 
271  $oldMessage = <<<ICS
272 BEGIN:VCALENDAR
273 VERSION:2.0
274 BEGIN:VEVENT
275 UID:foobar
276 SEQUENCE:1
277 DTSTART:20140716T120000Z
278 DTEND:20140716T130000Z
279 END:VEVENT
280 END:VCALENDAR
281 ICS;
282 
283 
284  $newMessage = <<<ICS
285 BEGIN:VCALENDAR
286 VERSION:2.0
287 BEGIN:VEVENT
288 UID:foobar
289 SEQUENCE:2
290 DTSTART:20140716T120000Z
291 DTEND:20140716T130000Z
292 END:VEVENT
293 END:VCALENDAR
294 ICS;
295 
297 
298  $expected = [];
299  $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org');
300 
301  }
302 
303  function testRemoveInstance() {
304 
305  $oldMessage = <<<ICS
306 BEGIN:VCALENDAR
307 VERSION:2.0
308 BEGIN:VEVENT
309 UID:foobar
310 SEQUENCE:1
311 ORGANIZER;CN=Strunk:mailto:strunk@example.org
312 ATTENDEE;CN=One:mailto:one@example.org
313 DTSTART;TZID=America/Toronto:20140716T120000
314 DTEND;TZID=America/Toronto:20140716T130000
315 RRULE:FREQ=WEEKLY
316 END:VEVENT
317 END:VCALENDAR
318 ICS;
319 
320 
321  $newMessage = <<<ICS
322 BEGIN:VCALENDAR
323 VERSION:2.0
324 BEGIN:VEVENT
325 UID:foobar
326 SEQUENCE:2
327 ORGANIZER;CN=Strunk:mailto:strunk@example.org
328 ATTENDEE;CN=One:mailto:one@example.org
329 DTSTART;TZID=America/Toronto:20140716T120000
330 DTEND;TZID=America/Toronto:20140716T130000
331 RRULE:FREQ=WEEKLY
332 EXDATE;TZID=America/Toronto:20140724T120000
333 END:VEVENT
334 END:VCALENDAR
335 ICS;
336 
338 
339  $expected = [
340  [
341  'uid' => 'foobar',
342  'method' => 'REQUEST',
343  'component' => 'VEVENT',
344  'sender' => 'mailto:strunk@example.org',
345  'senderName' => 'Strunk',
346  'recipient' => 'mailto:one@example.org',
347  'recipientName' => 'One',
348  'message' => <<<ICS
349 BEGIN:VCALENDAR
350 VERSION:2.0
351 PRODID:-//Sabre//Sabre VObject $version//EN
352 CALSCALE:GREGORIAN
353 METHOD:REQUEST
354 BEGIN:VEVENT
355 UID:foobar
356 SEQUENCE:2
357 ORGANIZER;CN=Strunk:mailto:strunk@example.org
358 ATTENDEE;CN=One;PARTSTAT=NEEDS-ACTION:mailto:one@example.org
359 DTSTART;TZID=America/Toronto:20140716T120000
360 DTEND;TZID=America/Toronto:20140716T130000
361 RRULE:FREQ=WEEKLY
362 EXDATE;TZID=America/Toronto:20140724T120000
363 END:VEVENT
364 END:VCALENDAR
365 ICS
366 
367  ],
368  ];
369 
370  $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org');
371 
372  }
373 
381 
382  $oldMessage = <<<ICS
383 BEGIN:VCALENDAR
384 VERSION:2.0
385 BEGIN:VEVENT
386 UID:foobar
387 DURATION:PT1H
388 SEQUENCE:1
389 ORGANIZER;CN=Strunk:mailto:strunk@example.org
390 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
391 ATTENDEE;CN=One:mailto:one@example.org
392 ATTENDEE;CN=Two:mailto:two@example.org
393 DTSTART:20140716T120000Z
394 DTEND:20140716T130000Z
395 END:VEVENT
396 END:VCALENDAR
397 ICS;
398 
399 
400  $newMessage = <<<ICS
401 BEGIN:VCALENDAR
402 VERSION:2.0
403 BEGIN:VEVENT
404 UID:foobar
405 DURATION:PT2H
406 SEQUENCE:2
407 ORGANIZER;CN=Strunk:mailto:strunk@example.org
408 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
409 ATTENDEE;CN=Two:mailto:two@example.org
410 ATTENDEE;CN=Three:mailto:three@example.org
411 DTSTART:20140716T120000Z
412 DTEND:20140716T130000Z
413 END:VEVENT
414 END:VCALENDAR
415 ICS;
416 
418 
419  $expected = [
420  [
421  'uid' => 'foobar',
422  'method' => 'CANCEL',
423  'component' => 'VEVENT',
424  'sender' => 'mailto:strunk@example.org',
425  'senderName' => 'Strunk',
426  'recipient' => 'mailto:one@example.org',
427  'recipientName' => 'One',
428  'significantChange' => true,
429  'message' => <<<ICS
430 BEGIN:VCALENDAR
431 VERSION:2.0
432 PRODID:-//Sabre//Sabre VObject $version//EN
433 CALSCALE:GREGORIAN
434 METHOD:CANCEL
435 BEGIN:VEVENT
436 UID:foobar
437 DTSTAMP:**ANY**
438 SEQUENCE:2
439 DTSTART:20140716T120000Z
440 DTEND:20140716T130000Z
441 ORGANIZER;CN=Strunk:mailto:strunk@example.org
442 ATTENDEE;CN=One:mailto:one@example.org
443 END:VEVENT
444 END:VCALENDAR
445 ICS
446 
447  ],
448  [
449  'uid' => 'foobar',
450  'method' => 'REQUEST',
451  'component' => 'VEVENT',
452  'sender' => 'mailto:strunk@example.org',
453  'senderName' => 'Strunk',
454  'recipient' => 'mailto:two@example.org',
455  'recipientName' => 'Two',
456  'significantChange' => true,
457  'message' => <<<ICS
458 BEGIN:VCALENDAR
459 VERSION:2.0
460 PRODID:-//Sabre//Sabre VObject $version//EN
461 CALSCALE:GREGORIAN
462 METHOD:REQUEST
463 BEGIN:VEVENT
464 UID:foobar
465 DURATION:PT2H
466 SEQUENCE:2
467 ORGANIZER;CN=Strunk:mailto:strunk@example.org
468 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
469 ATTENDEE;CN=Two;PARTSTAT=NEEDS-ACTION:mailto:two@example.org
470 ATTENDEE;CN=Three;PARTSTAT=NEEDS-ACTION:mailto:three@example.org
471 DTSTART:20140716T120000Z
472 DTEND:20140716T130000Z
473 END:VEVENT
474 END:VCALENDAR
475 ICS
476 
477  ],
478  [
479  'uid' => 'foobar',
480  'method' => 'REQUEST',
481  'component' => 'VEVENT',
482  'sender' => 'mailto:strunk@example.org',
483  'senderName' => 'Strunk',
484  'recipient' => 'mailto:three@example.org',
485  'recipientName' => 'Three',
486  'significantChange' => true,
487  'message' => <<<ICS
488 BEGIN:VCALENDAR
489 VERSION:2.0
490 PRODID:-//Sabre//Sabre VObject $version//EN
491 CALSCALE:GREGORIAN
492 METHOD:REQUEST
493 BEGIN:VEVENT
494 UID:foobar
495 DURATION:PT2H
496 SEQUENCE:2
497 ORGANIZER;CN=Strunk:mailto:strunk@example.org
498 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
499 ATTENDEE;CN=Two;PARTSTAT=NEEDS-ACTION:mailto:two@example.org
500 ATTENDEE;CN=Three;PARTSTAT=NEEDS-ACTION:mailto:three@example.org
501 DTSTART:20140716T120000Z
502 DTEND:20140716T130000Z
503 END:VEVENT
504 END:VCALENDAR
505 ICS
506 
507  ],
508  ];
509 
510  $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org');
511 
512  }
513 
514  function testInviteNoChange() {
515 
516  $oldMessage = <<<ICS
517 BEGIN:VCALENDAR
518 VERSION:2.0
519 BEGIN:VEVENT
520 UID:foobar
521 SEQUENCE:1
522 ORGANIZER;CN=Strunk:mailto:strunk@example.org
523 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
524 ATTENDEE;CN=One:mailto:one@example.org
525 DTSTART:20140716T120000Z
526 DTEND:20140716T130000Z
527 END:VEVENT
528 END:VCALENDAR
529 ICS;
530 
531 
532  $newMessage = <<<ICS
533 BEGIN:VCALENDAR
534 VERSION:2.0
535 BEGIN:VEVENT
536 UID:foobar
537 SEQUENCE:2
538 ORGANIZER;CN=Strunk:mailto:strunk@example.org
539 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
540 ATTENDEE;CN=One:mailto:one@example.org
541 DTSTART:20140716T120000Z
542 DTEND:20140716T130000Z
543 END:VEVENT
544 END:VCALENDAR
545 ICS;
546 
548 
549  $expected = [
550  [
551  'uid' => 'foobar',
552  'method' => 'REQUEST',
553  'component' => 'VEVENT',
554  'sender' => 'mailto:strunk@example.org',
555  'senderName' => 'Strunk',
556  'recipient' => 'mailto:one@example.org',
557  'recipientName' => 'One',
558  'significantChange' => false,
559  'message' => <<<ICS
560 BEGIN:VCALENDAR
561 VERSION:2.0
562 PRODID:-//Sabre//Sabre VObject $version//EN
563 CALSCALE:GREGORIAN
564 METHOD:REQUEST
565 BEGIN:VEVENT
566 UID:foobar
567 SEQUENCE:2
568 ORGANIZER;CN=Strunk:mailto:strunk@example.org
569 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
570 ATTENDEE;CN=One;PARTSTAT=NEEDS-ACTION:mailto:one@example.org
571 DTSTART:20140716T120000Z
572 DTEND:20140716T130000Z
573 END:VEVENT
574 END:VCALENDAR
575 ICS
576 
577  ],
578 
579  ];
580 
581  $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org');
582 
583  }
584 
586 
587  $oldMessage = <<<ICS
588 BEGIN:VCALENDAR
589 VERSION:2.0
590 BEGIN:VEVENT
591 UID:foobar
592 SEQUENCE:1
593 ORGANIZER;CN=Strunk:mailto:strunk@example.org
594 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
595 ATTENDEE;CN=One:mailto:one@example.org
596 DTSTART:20140716T120000Z
597 DTEND:20140716T130000Z
598 END:VEVENT
599 END:VCALENDAR
600 ICS;
601 
602 
603  $newMessage = <<<ICS
604 BEGIN:VCALENDAR
605 VERSION:2.0
606 BEGIN:VEVENT
607 UID:foobar
608 SEQUENCE:2
609 ORGANIZER;CN=Strunk:mailto:strunk@example.org
610 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
611 ATTENDEE;SCHEDULE-FORCE-SEND=REQUEST;CN=One:mailto:one@example.org
612 DTSTART:20140716T120000Z
613 DTEND:20140716T130000Z
614 END:VEVENT
615 END:VCALENDAR
616 ICS;
617 
619 
620  $expected = [
621  [
622  'uid' => 'foobar',
623  'method' => 'REQUEST',
624  'component' => 'VEVENT',
625  'sender' => 'mailto:strunk@example.org',
626  'senderName' => 'Strunk',
627  'recipient' => 'mailto:one@example.org',
628  'recipientName' => 'One',
629  'significantChange' => true,
630  'message' => <<<ICS
631 BEGIN:VCALENDAR
632 VERSION:2.0
633 PRODID:-//Sabre//Sabre VObject $version//EN
634 CALSCALE:GREGORIAN
635 METHOD:REQUEST
636 BEGIN:VEVENT
637 UID:foobar
638 SEQUENCE:2
639 ORGANIZER;CN=Strunk:mailto:strunk@example.org
640 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
641 ATTENDEE;CN=One;PARTSTAT=NEEDS-ACTION:mailto:one@example.org
642 DTSTART:20140716T120000Z
643 DTEND:20140716T130000Z
644 END:VEVENT
645 END:VCALENDAR
646 ICS
647 
648  ],
649 
650  ];
651 
652  $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org');
653 
654  }
655 
657 
658  $oldMessage = <<<ICS
659 BEGIN:VCALENDAR
660 VERSION:2.0
661 BEGIN:VEVENT
662 UID:foobar
663 SEQUENCE:1
664 SUMMARY:foo
665 ORGANIZER;CN=Strunk:mailto:strunk@example.org
666 ATTENDEE;CN=Strunk:mailto:strunk@example.org
667 ATTENDEE;CN=One:mailto:one@example.org
668 ATTENDEE;CN=Two:mailto:two@example.org
669 DTSTART:20140716T120000Z
670 DTEND:20140716T130000Z
671 END:VEVENT
672 END:VCALENDAR
673 ICS;
674 
675 
676  $newMessage = <<<ICS
677 BEGIN:VCALENDAR
678 VERSION:2.0
679 BEGIN:VEVENT
680 UID:foobar
681 SEQUENCE:2
682 SUMMARY:foo
683 DTSTART:20140716T120000Z
684 DTEND:20140716T130000Z
685 END:VEVENT
686 END:VCALENDAR
687 ICS;
688 
690 
691  $expected = [
692  [
693  'uid' => 'foobar',
694  'method' => 'CANCEL',
695  'component' => 'VEVENT',
696  'sender' => 'mailto:strunk@example.org',
697  'senderName' => 'Strunk',
698  'recipient' => 'mailto:one@example.org',
699  'recipientName' => 'One',
700  'significantChange' => true,
701  'message' => <<<ICS
702 BEGIN:VCALENDAR
703 VERSION:2.0
704 PRODID:-//Sabre//Sabre VObject $version//EN
705 CALSCALE:GREGORIAN
706 METHOD:CANCEL
707 BEGIN:VEVENT
708 UID:foobar
709 DTSTAMP:**ANY**
710 SEQUENCE:2
711 SUMMARY:foo
712 DTSTART:20140716T120000Z
713 DTEND:20140716T130000Z
714 ORGANIZER;CN=Strunk:mailto:strunk@example.org
715 ATTENDEE;CN=One:mailto:one@example.org
716 END:VEVENT
717 END:VCALENDAR
718 ICS
719 
720  ],
721  [
722  'uid' => 'foobar',
723  'method' => 'CANCEL',
724  'component' => 'VEVENT',
725  'sender' => 'mailto:strunk@example.org',
726  'senderName' => 'Strunk',
727  'recipient' => 'mailto:two@example.org',
728  'recipientName' => 'Two',
729  'significantChange' => true,
730  'message' => <<<ICS
731 BEGIN:VCALENDAR
732 VERSION:2.0
733 PRODID:-//Sabre//Sabre VObject $version//EN
734 CALSCALE:GREGORIAN
735 METHOD:CANCEL
736 BEGIN:VEVENT
737 UID:foobar
738 DTSTAMP:**ANY**
739 SEQUENCE:2
740 SUMMARY:foo
741 DTSTART:20140716T120000Z
742 DTEND:20140716T130000Z
743 ORGANIZER;CN=Strunk:mailto:strunk@example.org
744 ATTENDEE;CN=Two:mailto:two@example.org
745 END:VEVENT
746 END:VCALENDAR
747 ICS
748 
749  ],
750  ];
751 
752  $result = $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org');
753 
754  }
755 
757 
758  $oldMessage = <<<ICS
759 BEGIN:VCALENDAR
760 VERSION:2.0
761 PRODID:-//Apple Inc.//Mac OS X 10.10.1//EN
762 CALSCALE:GREGORIAN
763 BEGIN:VEVENT
764 UID:foobar
765 SEQUENCE:0
766 ORGANIZER;CN=Strunk:mailto:strunk@example.org
767 ATTENDEE;CN=Strunk;CUTYPE=INDIVIDUAL;EMAIL=strunk@example.org;PARTSTAT=ACCE
768  PTED:mailto:strunk@example.org
769 ATTENDEE;CN=One;CUTYPE=INDIVIDUAL;EMAIL=one@example.org;PARTSTAT=ACCEPTED;R
770  OLE=REQ-PARTICIPANT;SCHEDULE-STATUS="1.2;Message delivered locally":mailto
771  :one@example.org
772 SUMMARY:foo
773 DTSTART:20141211T160000Z
774 DTEND:20141211T170000Z
775 RRULE:FREQ=WEEKLY
776 EXDATE:20141225T160000Z,20150101T160000Z
777 EXDATE:20150108T160000Z
778 END:VEVENT
779 END:VCALENDAR
780 ICS;
781 
782 
783  $newMessage = <<<ICS
784 BEGIN:VCALENDAR
785 VERSION:2.0
786 PRODID:-//Apple Inc.//Mac OS X 10.10.1//EN
787 CALSCALE:GREGORIAN
788 BEGIN:VEVENT
789 UID:foobar
790 SEQUENCE:1
791 ORGANIZER;CN=Strunk:mailto:strunk@example.org
792 ATTENDEE;CN=Strunk;CUTYPE=INDIVIDUAL;EMAIL=strunk@example.org;PARTSTAT=ACCE
793  PTED:mailto:strunk@example.org
794 ATTENDEE;CN=One;CUTYPE=INDIVIDUAL;EMAIL=one@example.org;PARTSTAT=ACCEPTED;R
795  OLE=REQ-PARTICIPANT;SCHEDULE-STATUS=1.2:mailto:one@example.org
796 DTSTART:20141211T160000Z
797 DTEND:20141211T170000Z
798 RRULE:FREQ=WEEKLY
799 EXDATE:20150101T160000Z
800 EXDATE:20150108T160000Z,20141225T160000Z
801 END:VEVENT
802 END:VCALENDAR
803 ICS;
804 
806 
807  $expected = [
808  [
809  'uid' => 'foobar',
810  'method' => 'REQUEST',
811  'component' => 'VEVENT',
812  'sender' => 'mailto:strunk@example.org',
813  'senderName' => 'Strunk',
814  'recipient' => 'mailto:one@example.org',
815  'recipientName' => 'One',
816  'significantChange' => false,
817  'message' => <<<ICS
818 BEGIN:VCALENDAR
819 VERSION:2.0
820 PRODID:-//Sabre//Sabre VObject $version//EN
821 CALSCALE:GREGORIAN
822 METHOD:REQUEST
823 BEGIN:VEVENT
824 UID:foobar
825 SEQUENCE:1
826 ORGANIZER;CN=Strunk:mailto:strunk@example.org
827 ATTENDEE;CN=Strunk;CUTYPE=INDIVIDUAL;EMAIL=strunk@example.org;PARTSTAT=ACCE
828  PTED:mailto:strunk@example.org
829 ATTENDEE;CN=One;CUTYPE=INDIVIDUAL;EMAIL=one@example.org;PARTSTAT=ACCEPTED;R
830  OLE=REQ-PARTICIPANT:mailto:one@example.org
831 DTSTART:20141211T160000Z
832 DTEND:20141211T170000Z
833 RRULE:FREQ=WEEKLY
834 EXDATE:20150101T160000Z
835 EXDATE:20150108T160000Z,20141225T160000Z
836 END:VEVENT
837 END:VCALENDAR
838 ICS
839 
840  ],
841  ];
842 
843  $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org');
844 
845  }
846 }
$result
const VERSION
Full version number.
Definition: Version.php:17
$version
Definition: build.php:27
testInviteChangeSignificantChange()
This test is identical to the first test, except this time we change the DURATION property...
parse($oldMessage, $newMessage, $expected=[], $currentUser='mailto:one @example.org')
Utilities for testing the broker.