xref: /plugin/davcal/vendor/sabre/vobject/tests/VObject/ITip/BrokerAttendeeReplyTest.php (revision a1a3b6794e0e143a4a8b51d3185ce2d339be61ab)
1*a1a3b679SAndreas Boehler<?php
2*a1a3b679SAndreas Boehler
3*a1a3b679SAndreas Boehlernamespace Sabre\VObject\ITip;
4*a1a3b679SAndreas Boehler
5*a1a3b679SAndreas Boehlerclass BrokerAttendeeReplyTest extends BrokerTester {
6*a1a3b679SAndreas Boehler
7*a1a3b679SAndreas Boehler    function testAccepted() {
8*a1a3b679SAndreas Boehler
9*a1a3b679SAndreas Boehler        $oldMessage = <<<ICS
10*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
11*a1a3b679SAndreas BoehlerVERSION:2.0
12*a1a3b679SAndreas BoehlerBEGIN:VEVENT
13*a1a3b679SAndreas BoehlerUID:foobar
14*a1a3b679SAndreas BoehlerSUMMARY:B-day party
15*a1a3b679SAndreas BoehlerSEQUENCE:1
16*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
17*a1a3b679SAndreas BoehlerATTENDEE;CN=One:mailto:one@example.org
18*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z
19*a1a3b679SAndreas BoehlerEND:VEVENT
20*a1a3b679SAndreas BoehlerEND:VCALENDAR
21*a1a3b679SAndreas BoehlerICS;
22*a1a3b679SAndreas Boehler
23*a1a3b679SAndreas Boehler
24*a1a3b679SAndreas Boehler        $newMessage = <<<ICS
25*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
26*a1a3b679SAndreas BoehlerVERSION:2.0
27*a1a3b679SAndreas BoehlerBEGIN:VEVENT
28*a1a3b679SAndreas BoehlerUID:foobar
29*a1a3b679SAndreas BoehlerSUMMARY:B-day party
30*a1a3b679SAndreas BoehlerSEQUENCE:1
31*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
32*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=ACCEPTED;CN=One:mailto:one@example.org
33*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z
34*a1a3b679SAndreas BoehlerEND:VEVENT
35*a1a3b679SAndreas BoehlerEND:VCALENDAR
36*a1a3b679SAndreas BoehlerICS;
37*a1a3b679SAndreas Boehler
38*a1a3b679SAndreas Boehler        $version = \Sabre\VObject\Version::VERSION;
39*a1a3b679SAndreas Boehler
40*a1a3b679SAndreas Boehler        $expected = array(
41*a1a3b679SAndreas Boehler            array(
42*a1a3b679SAndreas Boehler                'uid' => 'foobar',
43*a1a3b679SAndreas Boehler                'method' => 'REPLY',
44*a1a3b679SAndreas Boehler                'component' => 'VEVENT',
45*a1a3b679SAndreas Boehler                'sender' => 'mailto:one@example.org',
46*a1a3b679SAndreas Boehler                'senderName' => 'One',
47*a1a3b679SAndreas Boehler                'recipient' => 'mailto:strunk@example.org',
48*a1a3b679SAndreas Boehler                'recipientName' => 'Strunk',
49*a1a3b679SAndreas Boehler                'message' => <<<ICS
50*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
51*a1a3b679SAndreas BoehlerVERSION:2.0
52*a1a3b679SAndreas BoehlerPRODID:-//Sabre//Sabre VObject $version//EN
53*a1a3b679SAndreas BoehlerCALSCALE:GREGORIAN
54*a1a3b679SAndreas BoehlerMETHOD:REPLY
55*a1a3b679SAndreas BoehlerBEGIN:VEVENT
56*a1a3b679SAndreas BoehlerUID:foobar
57*a1a3b679SAndreas BoehlerSEQUENCE:1
58*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z
59*a1a3b679SAndreas BoehlerSUMMARY:B-day party
60*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
61*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=ACCEPTED;CN=One:mailto:one@example.org
62*a1a3b679SAndreas BoehlerEND:VEVENT
63*a1a3b679SAndreas BoehlerEND:VCALENDAR
64*a1a3b679SAndreas BoehlerICS
65*a1a3b679SAndreas Boehler
66*a1a3b679SAndreas Boehler            ),
67*a1a3b679SAndreas Boehler
68*a1a3b679SAndreas Boehler        );
69*a1a3b679SAndreas Boehler
70*a1a3b679SAndreas Boehler        $result = $this->parse($oldMessage, $newMessage, $expected);
71*a1a3b679SAndreas Boehler
72*a1a3b679SAndreas Boehler    }
73*a1a3b679SAndreas Boehler
74*a1a3b679SAndreas Boehler    function testRecurringReply() {
75*a1a3b679SAndreas Boehler
76*a1a3b679SAndreas Boehler        $oldMessage = <<<ICS
77*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
78*a1a3b679SAndreas BoehlerVERSION:2.0
79*a1a3b679SAndreas BoehlerBEGIN:VEVENT
80*a1a3b679SAndreas BoehlerUID:foobar
81*a1a3b679SAndreas BoehlerSEQUENCE:1
82*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
83*a1a3b679SAndreas BoehlerATTENDEE;CN=One:mailto:one@example.org
84*a1a3b679SAndreas BoehlerDTSTART:20140724T120000Z
85*a1a3b679SAndreas BoehlerSUMMARY:Daily sprint
86*a1a3b679SAndreas BoehlerRRULE;FREQ=DAILY
87*a1a3b679SAndreas BoehlerEND:VEVENT
88*a1a3b679SAndreas BoehlerEND:VCALENDAR
89*a1a3b679SAndreas BoehlerICS;
90*a1a3b679SAndreas Boehler
91*a1a3b679SAndreas Boehler
92*a1a3b679SAndreas Boehler        $newMessage = <<<ICS
93*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
94*a1a3b679SAndreas BoehlerVERSION:2.0
95*a1a3b679SAndreas BoehlerBEGIN:VEVENT
96*a1a3b679SAndreas BoehlerUID:foobar
97*a1a3b679SAndreas BoehlerSEQUENCE:1
98*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
99*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=NEEDS-ACTION;CN=One:mailto:one@example.org
100*a1a3b679SAndreas BoehlerDTSTART:20140724T120000Z
101*a1a3b679SAndreas BoehlerSUMMARY:Daily sprint
102*a1a3b679SAndreas BoehlerEND:VEVENT
103*a1a3b679SAndreas BoehlerBEGIN:VEVENT
104*a1a3b679SAndreas BoehlerUID:foobar
105*a1a3b679SAndreas BoehlerSEQUENCE:1
106*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
107*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=ACCEPTED;CN=One:mailto:one@example.org
108*a1a3b679SAndreas BoehlerDTSTART:20140726T120000Z
109*a1a3b679SAndreas BoehlerRECURRENCE-ID:20140726T120000Z
110*a1a3b679SAndreas BoehlerEND:VEVENT
111*a1a3b679SAndreas BoehlerBEGIN:VEVENT
112*a1a3b679SAndreas BoehlerUID:foobar
113*a1a3b679SAndreas BoehlerSEQUENCE:1
114*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
115*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=DECLINED;CN=One:mailto:one@example.org
116*a1a3b679SAndreas BoehlerDTSTART:20140724T120000Z
117*a1a3b679SAndreas BoehlerRECURRENCE-ID:20140724T120000Z
118*a1a3b679SAndreas BoehlerEND:VEVENT
119*a1a3b679SAndreas BoehlerBEGIN:VEVENT
120*a1a3b679SAndreas BoehlerUID:foobar
121*a1a3b679SAndreas BoehlerSEQUENCE:1
122*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
123*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=TENTATIVE;CN=One:mailto:one@example.org
124*a1a3b679SAndreas BoehlerDTSTART:20140728T120000Z
125*a1a3b679SAndreas BoehlerRECURRENCE-ID:20140728T120000Z
126*a1a3b679SAndreas BoehlerEND:VEVENT
127*a1a3b679SAndreas BoehlerBEGIN:VEVENT
128*a1a3b679SAndreas BoehlerUID:foobar
129*a1a3b679SAndreas BoehlerSEQUENCE:1
130*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
131*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=ACCEPTED;CN=One:mailto:one@example.org
132*a1a3b679SAndreas BoehlerDTSTART:20140729T120000Z
133*a1a3b679SAndreas BoehlerRECURRENCE-ID:20140729T120000Z
134*a1a3b679SAndreas BoehlerEND:VEVENT
135*a1a3b679SAndreas BoehlerBEGIN:VEVENT
136*a1a3b679SAndreas BoehlerUID:foobar
137*a1a3b679SAndreas BoehlerSEQUENCE:1
138*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
139*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=DECLINED;CN=One:mailto:one@example.org
140*a1a3b679SAndreas BoehlerDTSTART:20140725T120000Z
141*a1a3b679SAndreas BoehlerRECURRENCE-ID:20140725T120000Z
142*a1a3b679SAndreas BoehlerEND:VEVENT
143*a1a3b679SAndreas BoehlerEND:VCALENDAR
144*a1a3b679SAndreas BoehlerICS;
145*a1a3b679SAndreas Boehler
146*a1a3b679SAndreas Boehler        $version = \Sabre\VObject\Version::VERSION;
147*a1a3b679SAndreas Boehler
148*a1a3b679SAndreas Boehler        $expected = array(
149*a1a3b679SAndreas Boehler            array(
150*a1a3b679SAndreas Boehler                'uid' => 'foobar',
151*a1a3b679SAndreas Boehler                'method' => 'REPLY',
152*a1a3b679SAndreas Boehler                'component' => 'VEVENT',
153*a1a3b679SAndreas Boehler                'sender' => 'mailto:one@example.org',
154*a1a3b679SAndreas Boehler                'senderName' => 'One',
155*a1a3b679SAndreas Boehler                'recipient' => 'mailto:strunk@example.org',
156*a1a3b679SAndreas Boehler                'recipientName' => 'Strunk',
157*a1a3b679SAndreas Boehler                'message' => <<<ICS
158*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
159*a1a3b679SAndreas BoehlerVERSION:2.0
160*a1a3b679SAndreas BoehlerPRODID:-//Sabre//Sabre VObject $version//EN
161*a1a3b679SAndreas BoehlerCALSCALE:GREGORIAN
162*a1a3b679SAndreas BoehlerMETHOD:REPLY
163*a1a3b679SAndreas BoehlerBEGIN:VEVENT
164*a1a3b679SAndreas BoehlerUID:foobar
165*a1a3b679SAndreas BoehlerSEQUENCE:1
166*a1a3b679SAndreas BoehlerDTSTART:20140726T120000Z
167*a1a3b679SAndreas BoehlerSUMMARY:Daily sprint
168*a1a3b679SAndreas BoehlerRECURRENCE-ID:20140726T120000Z
169*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
170*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=ACCEPTED;CN=One:mailto:one@example.org
171*a1a3b679SAndreas BoehlerEND:VEVENT
172*a1a3b679SAndreas BoehlerBEGIN:VEVENT
173*a1a3b679SAndreas BoehlerUID:foobar
174*a1a3b679SAndreas BoehlerSEQUENCE:1
175*a1a3b679SAndreas BoehlerDTSTART:20140724T120000Z
176*a1a3b679SAndreas BoehlerSUMMARY:Daily sprint
177*a1a3b679SAndreas BoehlerRECURRENCE-ID:20140724T120000Z
178*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
179*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=DECLINED;CN=One:mailto:one@example.org
180*a1a3b679SAndreas BoehlerEND:VEVENT
181*a1a3b679SAndreas BoehlerBEGIN:VEVENT
182*a1a3b679SAndreas BoehlerUID:foobar
183*a1a3b679SAndreas BoehlerSEQUENCE:1
184*a1a3b679SAndreas BoehlerDTSTART:20140728T120000Z
185*a1a3b679SAndreas BoehlerSUMMARY:Daily sprint
186*a1a3b679SAndreas BoehlerRECURRENCE-ID:20140728T120000Z
187*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
188*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=TENTATIVE;CN=One:mailto:one@example.org
189*a1a3b679SAndreas BoehlerEND:VEVENT
190*a1a3b679SAndreas BoehlerBEGIN:VEVENT
191*a1a3b679SAndreas BoehlerUID:foobar
192*a1a3b679SAndreas BoehlerSEQUENCE:1
193*a1a3b679SAndreas BoehlerDTSTART:20140729T120000Z
194*a1a3b679SAndreas BoehlerSUMMARY:Daily sprint
195*a1a3b679SAndreas BoehlerRECURRENCE-ID:20140729T120000Z
196*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
197*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=ACCEPTED;CN=One:mailto:one@example.org
198*a1a3b679SAndreas BoehlerEND:VEVENT
199*a1a3b679SAndreas BoehlerBEGIN:VEVENT
200*a1a3b679SAndreas BoehlerUID:foobar
201*a1a3b679SAndreas BoehlerSEQUENCE:1
202*a1a3b679SAndreas BoehlerDTSTART:20140725T120000Z
203*a1a3b679SAndreas BoehlerSUMMARY:Daily sprint
204*a1a3b679SAndreas BoehlerRECURRENCE-ID:20140725T120000Z
205*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
206*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=DECLINED;CN=One:mailto:one@example.org
207*a1a3b679SAndreas BoehlerEND:VEVENT
208*a1a3b679SAndreas BoehlerEND:VCALENDAR
209*a1a3b679SAndreas BoehlerICS
210*a1a3b679SAndreas Boehler
211*a1a3b679SAndreas Boehler            ),
212*a1a3b679SAndreas Boehler
213*a1a3b679SAndreas Boehler        );
214*a1a3b679SAndreas Boehler
215*a1a3b679SAndreas Boehler        $result = $this->parse($oldMessage, $newMessage, $expected);
216*a1a3b679SAndreas Boehler
217*a1a3b679SAndreas Boehler    }
218*a1a3b679SAndreas Boehler
219*a1a3b679SAndreas Boehler    function testRecurringAllDay() {
220*a1a3b679SAndreas Boehler
221*a1a3b679SAndreas Boehler        $oldMessage = <<<ICS
222*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
223*a1a3b679SAndreas BoehlerVERSION:2.0
224*a1a3b679SAndreas BoehlerBEGIN:VEVENT
225*a1a3b679SAndreas BoehlerUID:foobar
226*a1a3b679SAndreas BoehlerSEQUENCE:1
227*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
228*a1a3b679SAndreas BoehlerATTENDEE;CN=One:mailto:one@example.org
229*a1a3b679SAndreas BoehlerDTSTART;VALUE=DATE:20140724
230*a1a3b679SAndreas BoehlerRRULE;FREQ=DAILY
231*a1a3b679SAndreas BoehlerEND:VEVENT
232*a1a3b679SAndreas BoehlerEND:VCALENDAR
233*a1a3b679SAndreas BoehlerICS;
234*a1a3b679SAndreas Boehler
235*a1a3b679SAndreas Boehler
236*a1a3b679SAndreas Boehler    $newMessage = <<<ICS
237*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
238*a1a3b679SAndreas BoehlerVERSION:2.0
239*a1a3b679SAndreas BoehlerBEGIN:VEVENT
240*a1a3b679SAndreas BoehlerUID:foobar
241*a1a3b679SAndreas BoehlerSEQUENCE:1
242*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
243*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=NEEDS-ACTION;CN=One:mailto:one@example.org
244*a1a3b679SAndreas BoehlerDTSTART;VALUE=DATE:20140724
245*a1a3b679SAndreas BoehlerEND:VEVENT
246*a1a3b679SAndreas BoehlerBEGIN:VEVENT
247*a1a3b679SAndreas BoehlerUID:foobar
248*a1a3b679SAndreas BoehlerSEQUENCE:1
249*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
250*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=ACCEPTED;CN=One:mailto:one@example.org
251*a1a3b679SAndreas BoehlerDTSTART;VALUE=DATE:20140726
252*a1a3b679SAndreas BoehlerRECURRENCE-ID;VALUE=DATE:20140726
253*a1a3b679SAndreas BoehlerEND:VEVENT
254*a1a3b679SAndreas BoehlerBEGIN:VEVENT
255*a1a3b679SAndreas BoehlerUID:foobar
256*a1a3b679SAndreas BoehlerSEQUENCE:1
257*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
258*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=DECLINED;CN=One:mailto:one@example.org
259*a1a3b679SAndreas BoehlerDTSTART;VALUE=DATE:20140724
260*a1a3b679SAndreas BoehlerRECURRENCE-ID;VALUE=DATE:20140724
261*a1a3b679SAndreas BoehlerEND:VEVENT
262*a1a3b679SAndreas BoehlerBEGIN:VEVENT
263*a1a3b679SAndreas BoehlerUID:foobar
264*a1a3b679SAndreas BoehlerSEQUENCE:1
265*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
266*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=TENTATIVE;CN=One:mailto:one@example.org
267*a1a3b679SAndreas BoehlerDTSTART;VALUE=DATE:20140728
268*a1a3b679SAndreas BoehlerRECURRENCE-ID;VALUE=DATE:20140728
269*a1a3b679SAndreas BoehlerEND:VEVENT
270*a1a3b679SAndreas BoehlerBEGIN:VEVENT
271*a1a3b679SAndreas BoehlerUID:foobar
272*a1a3b679SAndreas BoehlerSEQUENCE:1
273*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
274*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=ACCEPTED;CN=One:mailto:one@example.org
275*a1a3b679SAndreas BoehlerDTSTART;VALUE=DATE:20140729
276*a1a3b679SAndreas BoehlerRECURRENCE-ID;VALUE=DATE:20140729
277*a1a3b679SAndreas BoehlerEND:VEVENT
278*a1a3b679SAndreas BoehlerBEGIN:VEVENT
279*a1a3b679SAndreas BoehlerUID:foobar
280*a1a3b679SAndreas BoehlerSEQUENCE:1
281*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
282*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=DECLINED;CN=One:mailto:one@example.org
283*a1a3b679SAndreas BoehlerDTSTART;VALUE=DATE:20140725
284*a1a3b679SAndreas BoehlerRECURRENCE-ID;VALUE=DATE:20140725
285*a1a3b679SAndreas BoehlerEND:VEVENT
286*a1a3b679SAndreas BoehlerEND:VCALENDAR
287*a1a3b679SAndreas BoehlerICS;
288*a1a3b679SAndreas Boehler
289*a1a3b679SAndreas Boehler    $version = \Sabre\VObject\Version::VERSION;
290*a1a3b679SAndreas Boehler
291*a1a3b679SAndreas Boehler    $expected = array(
292*a1a3b679SAndreas Boehler        array(
293*a1a3b679SAndreas Boehler            'uid' => 'foobar',
294*a1a3b679SAndreas Boehler            'method' => 'REPLY',
295*a1a3b679SAndreas Boehler            'component' => 'VEVENT',
296*a1a3b679SAndreas Boehler            'sender' => 'mailto:one@example.org',
297*a1a3b679SAndreas Boehler            'senderName' => 'One',
298*a1a3b679SAndreas Boehler            'recipient' => 'mailto:strunk@example.org',
299*a1a3b679SAndreas Boehler            'recipientName' => 'Strunk',
300*a1a3b679SAndreas Boehler            'message' => <<<ICS
301*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
302*a1a3b679SAndreas BoehlerVERSION:2.0
303*a1a3b679SAndreas BoehlerPRODID:-//Sabre//Sabre VObject $version//EN
304*a1a3b679SAndreas BoehlerCALSCALE:GREGORIAN
305*a1a3b679SAndreas BoehlerMETHOD:REPLY
306*a1a3b679SAndreas BoehlerBEGIN:VEVENT
307*a1a3b679SAndreas BoehlerUID:foobar
308*a1a3b679SAndreas BoehlerSEQUENCE:1
309*a1a3b679SAndreas BoehlerDTSTART;VALUE=DATE:20140726
310*a1a3b679SAndreas BoehlerRECURRENCE-ID;VALUE=DATE:20140726
311*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
312*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=ACCEPTED;CN=One:mailto:one@example.org
313*a1a3b679SAndreas BoehlerEND:VEVENT
314*a1a3b679SAndreas BoehlerBEGIN:VEVENT
315*a1a3b679SAndreas BoehlerUID:foobar
316*a1a3b679SAndreas BoehlerSEQUENCE:1
317*a1a3b679SAndreas BoehlerDTSTART;VALUE=DATE:20140724
318*a1a3b679SAndreas BoehlerRECURRENCE-ID;VALUE=DATE:20140724
319*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
320*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=DECLINED;CN=One:mailto:one@example.org
321*a1a3b679SAndreas BoehlerEND:VEVENT
322*a1a3b679SAndreas BoehlerBEGIN:VEVENT
323*a1a3b679SAndreas BoehlerUID:foobar
324*a1a3b679SAndreas BoehlerSEQUENCE:1
325*a1a3b679SAndreas BoehlerDTSTART;VALUE=DATE:20140728
326*a1a3b679SAndreas BoehlerRECURRENCE-ID;VALUE=DATE:20140728
327*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
328*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=TENTATIVE;CN=One:mailto:one@example.org
329*a1a3b679SAndreas BoehlerEND:VEVENT
330*a1a3b679SAndreas BoehlerBEGIN:VEVENT
331*a1a3b679SAndreas BoehlerUID:foobar
332*a1a3b679SAndreas BoehlerSEQUENCE:1
333*a1a3b679SAndreas BoehlerDTSTART;VALUE=DATE:20140729
334*a1a3b679SAndreas BoehlerRECURRENCE-ID;VALUE=DATE:20140729
335*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
336*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=ACCEPTED;CN=One:mailto:one@example.org
337*a1a3b679SAndreas BoehlerEND:VEVENT
338*a1a3b679SAndreas BoehlerBEGIN:VEVENT
339*a1a3b679SAndreas BoehlerUID:foobar
340*a1a3b679SAndreas BoehlerSEQUENCE:1
341*a1a3b679SAndreas BoehlerDTSTART;VALUE=DATE:20140725
342*a1a3b679SAndreas BoehlerRECURRENCE-ID;VALUE=DATE:20140725
343*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
344*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=DECLINED;CN=One:mailto:one@example.org
345*a1a3b679SAndreas BoehlerEND:VEVENT
346*a1a3b679SAndreas BoehlerEND:VCALENDAR
347*a1a3b679SAndreas BoehlerICS
348*a1a3b679SAndreas Boehler
349*a1a3b679SAndreas Boehler            ),
350*a1a3b679SAndreas Boehler
351*a1a3b679SAndreas Boehler        );
352*a1a3b679SAndreas Boehler
353*a1a3b679SAndreas Boehler        $result = $this->parse($oldMessage, $newMessage, $expected);
354*a1a3b679SAndreas Boehler
355*a1a3b679SAndreas Boehler    }
356*a1a3b679SAndreas Boehler
357*a1a3b679SAndreas Boehler    function testNoChange() {
358*a1a3b679SAndreas Boehler
359*a1a3b679SAndreas Boehler        $oldMessage = <<<ICS
360*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
361*a1a3b679SAndreas BoehlerVERSION:2.0
362*a1a3b679SAndreas BoehlerBEGIN:VEVENT
363*a1a3b679SAndreas BoehlerUID:foobar
364*a1a3b679SAndreas BoehlerSEQUENCE:1
365*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
366*a1a3b679SAndreas BoehlerATTENDEE;CN=One:mailto:one@example.org
367*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z
368*a1a3b679SAndreas BoehlerEND:VEVENT
369*a1a3b679SAndreas BoehlerEND:VCALENDAR
370*a1a3b679SAndreas BoehlerICS;
371*a1a3b679SAndreas Boehler
372*a1a3b679SAndreas Boehler
373*a1a3b679SAndreas Boehler        $newMessage = <<<ICS
374*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
375*a1a3b679SAndreas BoehlerVERSION:2.0
376*a1a3b679SAndreas BoehlerBEGIN:VEVENT
377*a1a3b679SAndreas BoehlerUID:foobar
378*a1a3b679SAndreas BoehlerSEQUENCE:1
379*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
380*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=NEEDS-ACTION;CN=One:mailto:one@example.org
381*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z
382*a1a3b679SAndreas BoehlerEND:VEVENT
383*a1a3b679SAndreas BoehlerEND:VCALENDAR
384*a1a3b679SAndreas BoehlerICS;
385*a1a3b679SAndreas Boehler
386*a1a3b679SAndreas Boehler
387*a1a3b679SAndreas Boehler        $expected = array();
388*a1a3b679SAndreas Boehler        $result = $this->parse($oldMessage, $newMessage, $expected);
389*a1a3b679SAndreas Boehler
390*a1a3b679SAndreas Boehler    }
391*a1a3b679SAndreas Boehler
392*a1a3b679SAndreas Boehler    function testNoChangeForceSend() {
393*a1a3b679SAndreas Boehler
394*a1a3b679SAndreas Boehler        $oldMessage = <<<ICS
395*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
396*a1a3b679SAndreas BoehlerVERSION:2.0
397*a1a3b679SAndreas BoehlerBEGIN:VEVENT
398*a1a3b679SAndreas BoehlerUID:foobar
399*a1a3b679SAndreas BoehlerSEQUENCE:1
400*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
401*a1a3b679SAndreas BoehlerATTENDEE;CN=One:mailto:one@example.org
402*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z
403*a1a3b679SAndreas BoehlerEND:VEVENT
404*a1a3b679SAndreas BoehlerEND:VCALENDAR
405*a1a3b679SAndreas BoehlerICS;
406*a1a3b679SAndreas Boehler
407*a1a3b679SAndreas Boehler
408*a1a3b679SAndreas Boehler        $newMessage = <<<ICS
409*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
410*a1a3b679SAndreas BoehlerVERSION:2.0
411*a1a3b679SAndreas BoehlerBEGIN:VEVENT
412*a1a3b679SAndreas BoehlerUID:foobar
413*a1a3b679SAndreas BoehlerSEQUENCE:1
414*a1a3b679SAndreas BoehlerORGANIZER;SCHEDULE-FORCE-SEND=REPLY;CN=Strunk:mailto:strunk@example.org
415*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=NEEDS-ACTION;CN=One:mailto:one@example.org
416*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z
417*a1a3b679SAndreas BoehlerEND:VEVENT
418*a1a3b679SAndreas BoehlerEND:VCALENDAR
419*a1a3b679SAndreas BoehlerICS;
420*a1a3b679SAndreas Boehler
421*a1a3b679SAndreas Boehler        $version = \Sabre\VObject\Version::VERSION;
422*a1a3b679SAndreas Boehler        $expected = array(
423*a1a3b679SAndreas Boehler            array(
424*a1a3b679SAndreas Boehler                'uid' => 'foobar',
425*a1a3b679SAndreas Boehler                'method' => 'REPLY',
426*a1a3b679SAndreas Boehler                'component' => 'VEVENT',
427*a1a3b679SAndreas Boehler                'sender' => 'mailto:one@example.org',
428*a1a3b679SAndreas Boehler                'senderName' => 'One',
429*a1a3b679SAndreas Boehler                'recipient' => 'mailto:strunk@example.org',
430*a1a3b679SAndreas Boehler                'recipientName' => 'Strunk',
431*a1a3b679SAndreas Boehler                'message' => <<<ICS
432*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
433*a1a3b679SAndreas BoehlerVERSION:2.0
434*a1a3b679SAndreas BoehlerPRODID:-//Sabre//Sabre VObject $version//EN
435*a1a3b679SAndreas BoehlerCALSCALE:GREGORIAN
436*a1a3b679SAndreas BoehlerMETHOD:REPLY
437*a1a3b679SAndreas BoehlerBEGIN:VEVENT
438*a1a3b679SAndreas BoehlerUID:foobar
439*a1a3b679SAndreas BoehlerSEQUENCE:1
440*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z
441*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
442*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=NEEDS-ACTION;CN=One:mailto:one@example.org
443*a1a3b679SAndreas BoehlerEND:VEVENT
444*a1a3b679SAndreas BoehlerEND:VCALENDAR
445*a1a3b679SAndreas BoehlerICS
446*a1a3b679SAndreas Boehler            )
447*a1a3b679SAndreas Boehler
448*a1a3b679SAndreas Boehler        );
449*a1a3b679SAndreas Boehler        $result = $this->parse($oldMessage, $newMessage, $expected);
450*a1a3b679SAndreas Boehler
451*a1a3b679SAndreas Boehler    }
452*a1a3b679SAndreas Boehler
453*a1a3b679SAndreas Boehler    function testNoRelevantAttendee() {
454*a1a3b679SAndreas Boehler
455*a1a3b679SAndreas Boehler        $oldMessage = <<<ICS
456*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
457*a1a3b679SAndreas BoehlerVERSION:2.0
458*a1a3b679SAndreas BoehlerBEGIN:VEVENT
459*a1a3b679SAndreas BoehlerUID:foobar
460*a1a3b679SAndreas BoehlerSEQUENCE:1
461*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
462*a1a3b679SAndreas BoehlerATTENDEE;CN=Two:mailto:two@example.org
463*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z
464*a1a3b679SAndreas BoehlerEND:VEVENT
465*a1a3b679SAndreas BoehlerEND:VCALENDAR
466*a1a3b679SAndreas BoehlerICS;
467*a1a3b679SAndreas Boehler
468*a1a3b679SAndreas Boehler
469*a1a3b679SAndreas Boehler        $newMessage = <<<ICS
470*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
471*a1a3b679SAndreas BoehlerVERSION:2.0
472*a1a3b679SAndreas BoehlerBEGIN:VEVENT
473*a1a3b679SAndreas BoehlerUID:foobar
474*a1a3b679SAndreas BoehlerSEQUENCE:1
475*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
476*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=ACCEPTED;CN=Two:mailto:two@example.org
477*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z
478*a1a3b679SAndreas BoehlerEND:VEVENT
479*a1a3b679SAndreas BoehlerEND:VCALENDAR
480*a1a3b679SAndreas BoehlerICS;
481*a1a3b679SAndreas Boehler
482*a1a3b679SAndreas Boehler        $expected = array();
483*a1a3b679SAndreas Boehler        $result = $this->parse($oldMessage, $newMessage, $expected);
484*a1a3b679SAndreas Boehler
485*a1a3b679SAndreas Boehler    }
486*a1a3b679SAndreas Boehler
487*a1a3b679SAndreas Boehler    /**
488*a1a3b679SAndreas Boehler     * In this test, an event exists in an attendees calendar. The event
489*a1a3b679SAndreas Boehler     * is recurring, and the attendee deletes 1 instance of the event.
490*a1a3b679SAndreas Boehler     * This instance shows up in EXDATE
491*a1a3b679SAndreas Boehler     *
492*a1a3b679SAndreas Boehler     * This should automatically generate a DECLINED message for that
493*a1a3b679SAndreas Boehler     * specific instance.
494*a1a3b679SAndreas Boehler     */
495*a1a3b679SAndreas Boehler    function testCreateReplyByException() {
496*a1a3b679SAndreas Boehler
497*a1a3b679SAndreas Boehler
498*a1a3b679SAndreas Boehler        $oldMessage = <<<ICS
499*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
500*a1a3b679SAndreas BoehlerVERSION:2.0
501*a1a3b679SAndreas BoehlerBEGIN:VEVENT
502*a1a3b679SAndreas BoehlerUID:foobar
503*a1a3b679SAndreas BoehlerSEQUENCE:1
504*a1a3b679SAndreas BoehlerDTSTART:20140811T200000Z
505*a1a3b679SAndreas BoehlerRRULE:FREQ=WEEKLY
506*a1a3b679SAndreas BoehlerORGANIZER:mailto:organizer@example.org
507*a1a3b679SAndreas BoehlerATTENDEE:mailto:one@example.org
508*a1a3b679SAndreas BoehlerEND:VEVENT
509*a1a3b679SAndreas BoehlerEND:VCALENDAR
510*a1a3b679SAndreas BoehlerICS;
511*a1a3b679SAndreas Boehler
512*a1a3b679SAndreas Boehler        $newMessage = <<<ICS
513*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
514*a1a3b679SAndreas BoehlerVERSION:2.0
515*a1a3b679SAndreas BoehlerBEGIN:VEVENT
516*a1a3b679SAndreas BoehlerUID:foobar
517*a1a3b679SAndreas BoehlerSEQUENCE:1
518*a1a3b679SAndreas BoehlerDTSTART:20140811T200000Z
519*a1a3b679SAndreas BoehlerRRULE:FREQ=WEEKLY
520*a1a3b679SAndreas BoehlerORGANIZER:mailto:organizer@example.org
521*a1a3b679SAndreas BoehlerATTENDEE:mailto:one@example.org
522*a1a3b679SAndreas BoehlerEXDATE:20140818T200000Z
523*a1a3b679SAndreas BoehlerEND:VEVENT
524*a1a3b679SAndreas BoehlerEND:VCALENDAR
525*a1a3b679SAndreas BoehlerICS;
526*a1a3b679SAndreas Boehler
527*a1a3b679SAndreas Boehler        $version = \Sabre\VObject\Version::VERSION;
528*a1a3b679SAndreas Boehler        $expected = array(
529*a1a3b679SAndreas Boehler            array(
530*a1a3b679SAndreas Boehler                'uid' => 'foobar',
531*a1a3b679SAndreas Boehler                'method' => 'REPLY',
532*a1a3b679SAndreas Boehler                'component' => 'VEVENT',
533*a1a3b679SAndreas Boehler                'sender' => 'mailto:one@example.org',
534*a1a3b679SAndreas Boehler                'senderName' => null,
535*a1a3b679SAndreas Boehler                'recipient' => 'mailto:organizer@example.org',
536*a1a3b679SAndreas Boehler                'recipientName' => null,
537*a1a3b679SAndreas Boehler                'message' => <<<ICS
538*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
539*a1a3b679SAndreas BoehlerVERSION:2.0
540*a1a3b679SAndreas BoehlerPRODID:-//Sabre//Sabre VObject $version//EN
541*a1a3b679SAndreas BoehlerCALSCALE:GREGORIAN
542*a1a3b679SAndreas BoehlerMETHOD:REPLY
543*a1a3b679SAndreas BoehlerBEGIN:VEVENT
544*a1a3b679SAndreas BoehlerUID:foobar
545*a1a3b679SAndreas BoehlerSEQUENCE:1
546*a1a3b679SAndreas BoehlerDTSTART:20140818T200000Z
547*a1a3b679SAndreas BoehlerRECURRENCE-ID:20140818T200000Z
548*a1a3b679SAndreas BoehlerORGANIZER:mailto:organizer@example.org
549*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=DECLINED:mailto:one@example.org
550*a1a3b679SAndreas BoehlerEND:VEVENT
551*a1a3b679SAndreas BoehlerEND:VCALENDAR
552*a1a3b679SAndreas BoehlerICS
553*a1a3b679SAndreas Boehler
554*a1a3b679SAndreas Boehler            ),
555*a1a3b679SAndreas Boehler        );
556*a1a3b679SAndreas Boehler        $result = $this->parse($oldMessage, $newMessage, $expected);
557*a1a3b679SAndreas Boehler
558*a1a3b679SAndreas Boehler    }
559*a1a3b679SAndreas Boehler
560*a1a3b679SAndreas Boehler    /**
561*a1a3b679SAndreas Boehler     * This test is identical to the last, but now we're working with
562*a1a3b679SAndreas Boehler     * timezones.
563*a1a3b679SAndreas Boehler     *
564*a1a3b679SAndreas Boehler     * @depends testCreateReplyByException
565*a1a3b679SAndreas Boehler     */
566*a1a3b679SAndreas Boehler    function testCreateReplyByExceptionTz() {
567*a1a3b679SAndreas Boehler
568*a1a3b679SAndreas Boehler
569*a1a3b679SAndreas Boehler        $oldMessage = <<<ICS
570*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
571*a1a3b679SAndreas BoehlerVERSION:2.0
572*a1a3b679SAndreas BoehlerBEGIN:VEVENT
573*a1a3b679SAndreas BoehlerUID:foobar
574*a1a3b679SAndreas BoehlerSEQUENCE:1
575*a1a3b679SAndreas BoehlerDTSTART;TZID=America/Toronto:20140811T200000
576*a1a3b679SAndreas BoehlerRRULE:FREQ=WEEKLY
577*a1a3b679SAndreas BoehlerORGANIZER:mailto:organizer@example.org
578*a1a3b679SAndreas BoehlerATTENDEE:mailto:one@example.org
579*a1a3b679SAndreas BoehlerEND:VEVENT
580*a1a3b679SAndreas BoehlerEND:VCALENDAR
581*a1a3b679SAndreas BoehlerICS;
582*a1a3b679SAndreas Boehler
583*a1a3b679SAndreas Boehler        $newMessage = <<<ICS
584*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
585*a1a3b679SAndreas BoehlerVERSION:2.0
586*a1a3b679SAndreas BoehlerBEGIN:VEVENT
587*a1a3b679SAndreas BoehlerUID:foobar
588*a1a3b679SAndreas BoehlerSEQUENCE:1
589*a1a3b679SAndreas BoehlerDTSTART;TZID=America/Toronto:20140811T200000
590*a1a3b679SAndreas BoehlerRRULE:FREQ=WEEKLY
591*a1a3b679SAndreas BoehlerORGANIZER:mailto:organizer@example.org
592*a1a3b679SAndreas BoehlerATTENDEE:mailto:one@example.org
593*a1a3b679SAndreas BoehlerEXDATE;TZID=America/Toronto:20140818T200000
594*a1a3b679SAndreas BoehlerEND:VEVENT
595*a1a3b679SAndreas BoehlerEND:VCALENDAR
596*a1a3b679SAndreas BoehlerICS;
597*a1a3b679SAndreas Boehler
598*a1a3b679SAndreas Boehler        $version = \Sabre\VObject\Version::VERSION;
599*a1a3b679SAndreas Boehler        $expected = array(
600*a1a3b679SAndreas Boehler            array(
601*a1a3b679SAndreas Boehler                'uid' => 'foobar',
602*a1a3b679SAndreas Boehler                'method' => 'REPLY',
603*a1a3b679SAndreas Boehler                'component' => 'VEVENT',
604*a1a3b679SAndreas Boehler                'sender' => 'mailto:one@example.org',
605*a1a3b679SAndreas Boehler                'senderName' => null,
606*a1a3b679SAndreas Boehler                'recipient' => 'mailto:organizer@example.org',
607*a1a3b679SAndreas Boehler                'recipientName' => null,
608*a1a3b679SAndreas Boehler                'message' => <<<ICS
609*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
610*a1a3b679SAndreas BoehlerVERSION:2.0
611*a1a3b679SAndreas BoehlerPRODID:-//Sabre//Sabre VObject $version//EN
612*a1a3b679SAndreas BoehlerCALSCALE:GREGORIAN
613*a1a3b679SAndreas BoehlerMETHOD:REPLY
614*a1a3b679SAndreas BoehlerBEGIN:VEVENT
615*a1a3b679SAndreas BoehlerUID:foobar
616*a1a3b679SAndreas BoehlerSEQUENCE:1
617*a1a3b679SAndreas BoehlerDTSTART;TZID=America/Toronto:20140818T200000
618*a1a3b679SAndreas BoehlerRECURRENCE-ID;TZID=America/Toronto:20140818T200000
619*a1a3b679SAndreas BoehlerORGANIZER:mailto:organizer@example.org
620*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=DECLINED:mailto:one@example.org
621*a1a3b679SAndreas BoehlerEND:VEVENT
622*a1a3b679SAndreas BoehlerEND:VCALENDAR
623*a1a3b679SAndreas BoehlerICS
624*a1a3b679SAndreas Boehler
625*a1a3b679SAndreas Boehler            ),
626*a1a3b679SAndreas Boehler        );
627*a1a3b679SAndreas Boehler        $result = $this->parse($oldMessage, $newMessage, $expected);
628*a1a3b679SAndreas Boehler
629*a1a3b679SAndreas Boehler    }
630*a1a3b679SAndreas Boehler
631*a1a3b679SAndreas Boehler    /**
632*a1a3b679SAndreas Boehler     * @depends testCreateReplyByException
633*a1a3b679SAndreas Boehler     */
634*a1a3b679SAndreas Boehler    function testCreateReplyByExceptionAllDay() {
635*a1a3b679SAndreas Boehler
636*a1a3b679SAndreas Boehler
637*a1a3b679SAndreas Boehler        $oldMessage = <<<ICS
638*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
639*a1a3b679SAndreas BoehlerVERSION:2.0
640*a1a3b679SAndreas BoehlerBEGIN:VEVENT
641*a1a3b679SAndreas BoehlerSUMMARY:Weekly meeting
642*a1a3b679SAndreas BoehlerUID:foobar
643*a1a3b679SAndreas BoehlerSEQUENCE:1
644*a1a3b679SAndreas BoehlerDTSTART;VALUE=DATE:20140811
645*a1a3b679SAndreas BoehlerRRULE:FREQ=WEEKLY
646*a1a3b679SAndreas BoehlerORGANIZER:mailto:organizer@example.org
647*a1a3b679SAndreas BoehlerATTENDEE:mailto:one@example.org
648*a1a3b679SAndreas BoehlerEND:VEVENT
649*a1a3b679SAndreas BoehlerEND:VCALENDAR
650*a1a3b679SAndreas BoehlerICS;
651*a1a3b679SAndreas Boehler
652*a1a3b679SAndreas Boehler        $newMessage = <<<ICS
653*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
654*a1a3b679SAndreas BoehlerVERSION:2.0
655*a1a3b679SAndreas BoehlerBEGIN:VEVENT
656*a1a3b679SAndreas BoehlerSUMMARY:Weekly meeting
657*a1a3b679SAndreas BoehlerUID:foobar
658*a1a3b679SAndreas BoehlerSEQUENCE:1
659*a1a3b679SAndreas BoehlerDTSTART;VALUE=DATE:20140811
660*a1a3b679SAndreas BoehlerRRULE:FREQ=WEEKLY
661*a1a3b679SAndreas BoehlerORGANIZER:mailto:organizer@example.org
662*a1a3b679SAndreas BoehlerATTENDEE:mailto:one@example.org
663*a1a3b679SAndreas BoehlerEXDATE;VALUE=DATE:20140818
664*a1a3b679SAndreas BoehlerEND:VEVENT
665*a1a3b679SAndreas BoehlerEND:VCALENDAR
666*a1a3b679SAndreas BoehlerICS;
667*a1a3b679SAndreas Boehler
668*a1a3b679SAndreas Boehler        $version = \Sabre\VObject\Version::VERSION;
669*a1a3b679SAndreas Boehler        $expected = array(
670*a1a3b679SAndreas Boehler            array(
671*a1a3b679SAndreas Boehler                'uid' => 'foobar',
672*a1a3b679SAndreas Boehler                'method' => 'REPLY',
673*a1a3b679SAndreas Boehler                'component' => 'VEVENT',
674*a1a3b679SAndreas Boehler                'sender' => 'mailto:one@example.org',
675*a1a3b679SAndreas Boehler                'senderName' => null,
676*a1a3b679SAndreas Boehler                'recipient' => 'mailto:organizer@example.org',
677*a1a3b679SAndreas Boehler                'recipientName' => null,
678*a1a3b679SAndreas Boehler                'message' => <<<ICS
679*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
680*a1a3b679SAndreas BoehlerVERSION:2.0
681*a1a3b679SAndreas BoehlerPRODID:-//Sabre//Sabre VObject $version//EN
682*a1a3b679SAndreas BoehlerCALSCALE:GREGORIAN
683*a1a3b679SAndreas BoehlerMETHOD:REPLY
684*a1a3b679SAndreas BoehlerBEGIN:VEVENT
685*a1a3b679SAndreas BoehlerUID:foobar
686*a1a3b679SAndreas BoehlerSEQUENCE:1
687*a1a3b679SAndreas BoehlerDTSTART;VALUE=DATE:20140818
688*a1a3b679SAndreas BoehlerSUMMARY:Weekly meeting
689*a1a3b679SAndreas BoehlerRECURRENCE-ID;VALUE=DATE:20140818
690*a1a3b679SAndreas BoehlerORGANIZER:mailto:organizer@example.org
691*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=DECLINED:mailto:one@example.org
692*a1a3b679SAndreas BoehlerEND:VEVENT
693*a1a3b679SAndreas BoehlerEND:VCALENDAR
694*a1a3b679SAndreas BoehlerICS
695*a1a3b679SAndreas Boehler
696*a1a3b679SAndreas Boehler            ),
697*a1a3b679SAndreas Boehler        );
698*a1a3b679SAndreas Boehler        $result = $this->parse($oldMessage, $newMessage, $expected);
699*a1a3b679SAndreas Boehler
700*a1a3b679SAndreas Boehler    }
701*a1a3b679SAndreas Boehler
702*a1a3b679SAndreas Boehler    function testDeclined() {
703*a1a3b679SAndreas Boehler
704*a1a3b679SAndreas Boehler        $oldMessage = <<<ICS
705*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
706*a1a3b679SAndreas BoehlerVERSION:2.0
707*a1a3b679SAndreas BoehlerBEGIN:VEVENT
708*a1a3b679SAndreas BoehlerUID:foobar
709*a1a3b679SAndreas BoehlerSEQUENCE:1
710*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
711*a1a3b679SAndreas BoehlerATTENDEE;CN=One:mailto:one@example.org
712*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z
713*a1a3b679SAndreas BoehlerEND:VEVENT
714*a1a3b679SAndreas BoehlerEND:VCALENDAR
715*a1a3b679SAndreas BoehlerICS;
716*a1a3b679SAndreas Boehler
717*a1a3b679SAndreas Boehler
718*a1a3b679SAndreas Boehler        $newMessage = <<<ICS
719*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
720*a1a3b679SAndreas BoehlerVERSION:2.0
721*a1a3b679SAndreas BoehlerBEGIN:VEVENT
722*a1a3b679SAndreas BoehlerUID:foobar
723*a1a3b679SAndreas BoehlerSEQUENCE:1
724*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
725*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=DECLINED;CN=One:mailto:one@example.org
726*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z
727*a1a3b679SAndreas BoehlerEND:VEVENT
728*a1a3b679SAndreas BoehlerEND:VCALENDAR
729*a1a3b679SAndreas BoehlerICS;
730*a1a3b679SAndreas Boehler
731*a1a3b679SAndreas Boehler        $version = \Sabre\VObject\Version::VERSION;
732*a1a3b679SAndreas Boehler
733*a1a3b679SAndreas Boehler        $expected = array(
734*a1a3b679SAndreas Boehler            array(
735*a1a3b679SAndreas Boehler                'uid' => 'foobar',
736*a1a3b679SAndreas Boehler                'method' => 'REPLY',
737*a1a3b679SAndreas Boehler                'component' => 'VEVENT',
738*a1a3b679SAndreas Boehler                'sender' => 'mailto:one@example.org',
739*a1a3b679SAndreas Boehler                'senderName' => 'One',
740*a1a3b679SAndreas Boehler                'recipient' => 'mailto:strunk@example.org',
741*a1a3b679SAndreas Boehler                'recipientName' => 'Strunk',
742*a1a3b679SAndreas Boehler                'message' => <<<ICS
743*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
744*a1a3b679SAndreas BoehlerVERSION:2.0
745*a1a3b679SAndreas BoehlerPRODID:-//Sabre//Sabre VObject $version//EN
746*a1a3b679SAndreas BoehlerCALSCALE:GREGORIAN
747*a1a3b679SAndreas BoehlerMETHOD:REPLY
748*a1a3b679SAndreas BoehlerBEGIN:VEVENT
749*a1a3b679SAndreas BoehlerUID:foobar
750*a1a3b679SAndreas BoehlerSEQUENCE:1
751*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z
752*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
753*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=DECLINED;CN=One:mailto:one@example.org
754*a1a3b679SAndreas BoehlerEND:VEVENT
755*a1a3b679SAndreas BoehlerEND:VCALENDAR
756*a1a3b679SAndreas BoehlerICS
757*a1a3b679SAndreas Boehler
758*a1a3b679SAndreas Boehler            ),
759*a1a3b679SAndreas Boehler
760*a1a3b679SAndreas Boehler        );
761*a1a3b679SAndreas Boehler
762*a1a3b679SAndreas Boehler        $result = $this->parse($oldMessage, $newMessage, $expected);
763*a1a3b679SAndreas Boehler
764*a1a3b679SAndreas Boehler    }
765*a1a3b679SAndreas Boehler
766*a1a3b679SAndreas Boehler    function testDeclinedCancelledEvent() {
767*a1a3b679SAndreas Boehler
768*a1a3b679SAndreas Boehler        $oldMessage = <<<ICS
769*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
770*a1a3b679SAndreas BoehlerVERSION:2.0
771*a1a3b679SAndreas BoehlerBEGIN:VEVENT
772*a1a3b679SAndreas BoehlerSTATUS:CANCELLED
773*a1a3b679SAndreas BoehlerUID:foobar
774*a1a3b679SAndreas BoehlerSEQUENCE:1
775*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
776*a1a3b679SAndreas BoehlerATTENDEE;CN=One:mailto:one@example.org
777*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z
778*a1a3b679SAndreas BoehlerEND:VEVENT
779*a1a3b679SAndreas BoehlerEND:VCALENDAR
780*a1a3b679SAndreas BoehlerICS;
781*a1a3b679SAndreas Boehler
782*a1a3b679SAndreas Boehler
783*a1a3b679SAndreas Boehler        $newMessage = <<<ICS
784*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
785*a1a3b679SAndreas BoehlerVERSION:2.0
786*a1a3b679SAndreas BoehlerBEGIN:VEVENT
787*a1a3b679SAndreas BoehlerSTATUS:CANCELLED
788*a1a3b679SAndreas BoehlerUID:foobar
789*a1a3b679SAndreas BoehlerSEQUENCE:1
790*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
791*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=DECLINED;CN=One:mailto:one@example.org
792*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z
793*a1a3b679SAndreas BoehlerEND:VEVENT
794*a1a3b679SAndreas BoehlerEND:VCALENDAR
795*a1a3b679SAndreas BoehlerICS;
796*a1a3b679SAndreas Boehler
797*a1a3b679SAndreas Boehler        $version = \Sabre\VObject\Version::VERSION;
798*a1a3b679SAndreas Boehler
799*a1a3b679SAndreas Boehler        $expected = array();
800*a1a3b679SAndreas Boehler
801*a1a3b679SAndreas Boehler        $result = $this->parse($oldMessage, $newMessage, $expected);
802*a1a3b679SAndreas Boehler
803*a1a3b679SAndreas Boehler    }
804*a1a3b679SAndreas Boehler
805*a1a3b679SAndreas Boehler    /**
806*a1a3b679SAndreas Boehler     * In this test, a new exception is created by an attendee as well.
807*a1a3b679SAndreas Boehler     *
808*a1a3b679SAndreas Boehler     * Except in this case, there was already an overridden event, and the
809*a1a3b679SAndreas Boehler     * overridden event was marked as cancelled by the attendee.
810*a1a3b679SAndreas Boehler     *
811*a1a3b679SAndreas Boehler     * For any other attendence status, the new status would have been
812*a1a3b679SAndreas Boehler     * declined, but for this, no message should we sent.
813*a1a3b679SAndreas Boehler     */
814*a1a3b679SAndreas Boehler    function testDontCreateReplyWhenEventWasDeclined() {
815*a1a3b679SAndreas Boehler
816*a1a3b679SAndreas Boehler
817*a1a3b679SAndreas Boehler        $oldMessage = <<<ICS
818*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
819*a1a3b679SAndreas BoehlerVERSION:2.0
820*a1a3b679SAndreas BoehlerBEGIN:VEVENT
821*a1a3b679SAndreas BoehlerUID:foobar
822*a1a3b679SAndreas BoehlerSEQUENCE:1
823*a1a3b679SAndreas BoehlerDTSTART:20140811T200000Z
824*a1a3b679SAndreas BoehlerRRULE:FREQ=WEEKLY
825*a1a3b679SAndreas BoehlerORGANIZER:mailto:organizer@example.org
826*a1a3b679SAndreas BoehlerATTENDEE:mailto:one@example.org
827*a1a3b679SAndreas BoehlerEND:VEVENT
828*a1a3b679SAndreas BoehlerBEGIN:VEVENT
829*a1a3b679SAndreas BoehlerRECURRENCE-ID:20140818T200000Z
830*a1a3b679SAndreas BoehlerUID:foobar
831*a1a3b679SAndreas BoehlerSEQUENCE:1
832*a1a3b679SAndreas BoehlerDTSTART:20140818T200000Z
833*a1a3b679SAndreas BoehlerRRULE:FREQ=WEEKLY
834*a1a3b679SAndreas BoehlerORGANIZER:mailto:organizer@example.org
835*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=DECLINED:mailto:one@example.org
836*a1a3b679SAndreas BoehlerEND:VEVENT
837*a1a3b679SAndreas BoehlerEND:VCALENDAR
838*a1a3b679SAndreas BoehlerICS;
839*a1a3b679SAndreas Boehler
840*a1a3b679SAndreas Boehler        $newMessage = <<<ICS
841*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
842*a1a3b679SAndreas BoehlerVERSION:2.0
843*a1a3b679SAndreas BoehlerBEGIN:VEVENT
844*a1a3b679SAndreas BoehlerUID:foobar
845*a1a3b679SAndreas BoehlerSEQUENCE:1
846*a1a3b679SAndreas BoehlerDTSTART:20140811T200000Z
847*a1a3b679SAndreas BoehlerRRULE:FREQ=WEEKLY
848*a1a3b679SAndreas BoehlerORGANIZER:mailto:organizer@example.org
849*a1a3b679SAndreas BoehlerATTENDEE:mailto:one@example.org
850*a1a3b679SAndreas BoehlerEXDATE:20140818T200000Z
851*a1a3b679SAndreas BoehlerEND:VEVENT
852*a1a3b679SAndreas BoehlerEND:VCALENDAR
853*a1a3b679SAndreas BoehlerICS;
854*a1a3b679SAndreas Boehler
855*a1a3b679SAndreas Boehler        $version = \Sabre\VObject\Version::VERSION;
856*a1a3b679SAndreas Boehler        $expected = array();
857*a1a3b679SAndreas Boehler
858*a1a3b679SAndreas Boehler        $result = $this->parse($oldMessage, $newMessage, $expected);
859*a1a3b679SAndreas Boehler
860*a1a3b679SAndreas Boehler    }
861*a1a3b679SAndreas Boehler
862*a1a3b679SAndreas Boehler    function testScheduleAgentOnOrganizer() {
863*a1a3b679SAndreas Boehler
864*a1a3b679SAndreas Boehler        $oldMessage = <<<ICS
865*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
866*a1a3b679SAndreas BoehlerVERSION:2.0
867*a1a3b679SAndreas BoehlerBEGIN:VEVENT
868*a1a3b679SAndreas BoehlerUID:foobar
869*a1a3b679SAndreas BoehlerSEQUENCE:1
870*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
871*a1a3b679SAndreas BoehlerATTENDEE;CN=One:mailto:one@example.org
872*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z
873*a1a3b679SAndreas BoehlerEND:VEVENT
874*a1a3b679SAndreas BoehlerEND:VCALENDAR
875*a1a3b679SAndreas BoehlerICS;
876*a1a3b679SAndreas Boehler
877*a1a3b679SAndreas Boehler
878*a1a3b679SAndreas Boehler        $newMessage = <<<ICS
879*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
880*a1a3b679SAndreas BoehlerVERSION:2.0
881*a1a3b679SAndreas BoehlerBEGIN:VEVENT
882*a1a3b679SAndreas BoehlerUID:foobar
883*a1a3b679SAndreas BoehlerSEQUENCE:1
884*a1a3b679SAndreas BoehlerORGANIZER;SCHEDULE-AGENT=CLIENT;CN=Strunk:mailto:strunk@example.org
885*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=ACCEPTED;CN=One:mailto:one@example.org
886*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z
887*a1a3b679SAndreas BoehlerEND:VEVENT
888*a1a3b679SAndreas BoehlerEND:VCALENDAR
889*a1a3b679SAndreas BoehlerICS;
890*a1a3b679SAndreas Boehler
891*a1a3b679SAndreas Boehler        $version = \Sabre\VObject\Version::VERSION;
892*a1a3b679SAndreas Boehler
893*a1a3b679SAndreas Boehler        $expected = array();
894*a1a3b679SAndreas Boehler        $result = $this->parse($oldMessage, $newMessage, $expected);
895*a1a3b679SAndreas Boehler
896*a1a3b679SAndreas Boehler    }
897*a1a3b679SAndreas Boehler
898*a1a3b679SAndreas Boehler    function testAcceptedAllDay() {
899*a1a3b679SAndreas Boehler
900*a1a3b679SAndreas Boehler        $oldMessage = <<<ICS
901*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
902*a1a3b679SAndreas BoehlerVERSION:2.0
903*a1a3b679SAndreas BoehlerBEGIN:VEVENT
904*a1a3b679SAndreas BoehlerUID:foobar
905*a1a3b679SAndreas BoehlerSEQUENCE:1
906*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
907*a1a3b679SAndreas BoehlerATTENDEE;CN=One:mailto:one@example.org
908*a1a3b679SAndreas BoehlerDTSTART;VALUE=DATE:20140716
909*a1a3b679SAndreas BoehlerEND:VEVENT
910*a1a3b679SAndreas BoehlerEND:VCALENDAR
911*a1a3b679SAndreas BoehlerICS;
912*a1a3b679SAndreas Boehler
913*a1a3b679SAndreas Boehler
914*a1a3b679SAndreas Boehler        $newMessage = <<<ICS
915*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
916*a1a3b679SAndreas BoehlerVERSION:2.0
917*a1a3b679SAndreas BoehlerBEGIN:VEVENT
918*a1a3b679SAndreas BoehlerUID:foobar
919*a1a3b679SAndreas BoehlerSEQUENCE:1
920*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
921*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=ACCEPTED;CN=One:mailto:one@example.org
922*a1a3b679SAndreas BoehlerDTSTART;VALUE=DATE:20140716
923*a1a3b679SAndreas BoehlerEND:VEVENT
924*a1a3b679SAndreas BoehlerEND:VCALENDAR
925*a1a3b679SAndreas BoehlerICS;
926*a1a3b679SAndreas Boehler
927*a1a3b679SAndreas Boehler        $version = \Sabre\VObject\Version::VERSION;
928*a1a3b679SAndreas Boehler
929*a1a3b679SAndreas Boehler        $expected = array(
930*a1a3b679SAndreas Boehler            array(
931*a1a3b679SAndreas Boehler                'uid' => 'foobar',
932*a1a3b679SAndreas Boehler                'method' => 'REPLY',
933*a1a3b679SAndreas Boehler                'component' => 'VEVENT',
934*a1a3b679SAndreas Boehler                'sender' => 'mailto:one@example.org',
935*a1a3b679SAndreas Boehler                'senderName' => 'One',
936*a1a3b679SAndreas Boehler                'recipient' => 'mailto:strunk@example.org',
937*a1a3b679SAndreas Boehler                'recipientName' => 'Strunk',
938*a1a3b679SAndreas Boehler                'message' => <<<ICS
939*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
940*a1a3b679SAndreas BoehlerVERSION:2.0
941*a1a3b679SAndreas BoehlerPRODID:-//Sabre//Sabre VObject $version//EN
942*a1a3b679SAndreas BoehlerCALSCALE:GREGORIAN
943*a1a3b679SAndreas BoehlerMETHOD:REPLY
944*a1a3b679SAndreas BoehlerBEGIN:VEVENT
945*a1a3b679SAndreas BoehlerUID:foobar
946*a1a3b679SAndreas BoehlerSEQUENCE:1
947*a1a3b679SAndreas BoehlerDTSTART;VALUE=DATE:20140716
948*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
949*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=ACCEPTED;CN=One:mailto:one@example.org
950*a1a3b679SAndreas BoehlerEND:VEVENT
951*a1a3b679SAndreas BoehlerEND:VCALENDAR
952*a1a3b679SAndreas BoehlerICS
953*a1a3b679SAndreas Boehler
954*a1a3b679SAndreas Boehler            ),
955*a1a3b679SAndreas Boehler
956*a1a3b679SAndreas Boehler        );
957*a1a3b679SAndreas Boehler
958*a1a3b679SAndreas Boehler        $result = $this->parse($oldMessage, $newMessage, $expected);
959*a1a3b679SAndreas Boehler
960*a1a3b679SAndreas Boehler    }
961*a1a3b679SAndreas Boehler
962*a1a3b679SAndreas Boehler    /**
963*a1a3b679SAndreas Boehler     * This function tests an attendee updating their status to an event where
964*a1a3b679SAndreas Boehler     * they don't have the master event of.
965*a1a3b679SAndreas Boehler     *
966*a1a3b679SAndreas Boehler     * This is possible in cases an organizer created a recurring event, and
967*a1a3b679SAndreas Boehler     * invited an attendee for one instance of the event.
968*a1a3b679SAndreas Boehler     */
969*a1a3b679SAndreas Boehler    function testReplyNoMasterEvent() {
970*a1a3b679SAndreas Boehler
971*a1a3b679SAndreas Boehler        $oldMessage = <<<ICS
972*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
973*a1a3b679SAndreas BoehlerVERSION:2.0
974*a1a3b679SAndreas BoehlerBEGIN:VEVENT
975*a1a3b679SAndreas BoehlerUID:foobar
976*a1a3b679SAndreas BoehlerSEQUENCE:1
977*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
978*a1a3b679SAndreas BoehlerATTENDEE;CN=One:mailto:one@example.org
979*a1a3b679SAndreas BoehlerRECURRENCE-ID:20140724T120000Z
980*a1a3b679SAndreas BoehlerDTSTART:20140724T120000Z
981*a1a3b679SAndreas BoehlerSUMMARY:Daily sprint
982*a1a3b679SAndreas BoehlerEND:VEVENT
983*a1a3b679SAndreas BoehlerEND:VCALENDAR
984*a1a3b679SAndreas BoehlerICS;
985*a1a3b679SAndreas Boehler
986*a1a3b679SAndreas Boehler
987*a1a3b679SAndreas Boehler        $newMessage = <<<ICS
988*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
989*a1a3b679SAndreas BoehlerVERSION:2.0
990*a1a3b679SAndreas BoehlerBEGIN:VEVENT
991*a1a3b679SAndreas BoehlerUID:foobar
992*a1a3b679SAndreas BoehlerSEQUENCE:1
993*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
994*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=ACCEPTED;CN=One:mailto:one@example.org
995*a1a3b679SAndreas BoehlerRECURRENCE-ID:20140724T120000Z
996*a1a3b679SAndreas BoehlerDTSTART:20140724T120000Z
997*a1a3b679SAndreas BoehlerSUMMARY:Daily sprint
998*a1a3b679SAndreas BoehlerEND:VEVENT
999*a1a3b679SAndreas BoehlerEND:VCALENDAR
1000*a1a3b679SAndreas BoehlerICS;
1001*a1a3b679SAndreas Boehler
1002*a1a3b679SAndreas Boehler        $version = \Sabre\VObject\Version::VERSION;
1003*a1a3b679SAndreas Boehler
1004*a1a3b679SAndreas Boehler        $expected = array(
1005*a1a3b679SAndreas Boehler            array(
1006*a1a3b679SAndreas Boehler                'uid' => 'foobar',
1007*a1a3b679SAndreas Boehler                'method' => 'REPLY',
1008*a1a3b679SAndreas Boehler                'component' => 'VEVENT',
1009*a1a3b679SAndreas Boehler                'sender' => 'mailto:one@example.org',
1010*a1a3b679SAndreas Boehler                'senderName' => 'One',
1011*a1a3b679SAndreas Boehler                'recipient' => 'mailto:strunk@example.org',
1012*a1a3b679SAndreas Boehler                'recipientName' => 'Strunk',
1013*a1a3b679SAndreas Boehler                'message' => <<<ICS
1014*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
1015*a1a3b679SAndreas BoehlerVERSION:2.0
1016*a1a3b679SAndreas BoehlerCALSCALE:GREGORIAN
1017*a1a3b679SAndreas BoehlerMETHOD:REPLY
1018*a1a3b679SAndreas BoehlerBEGIN:VEVENT
1019*a1a3b679SAndreas BoehlerUID:foobar
1020*a1a3b679SAndreas BoehlerSEQUENCE:1
1021*a1a3b679SAndreas BoehlerDTSTART:20140724T120000Z
1022*a1a3b679SAndreas BoehlerSUMMARY:Daily sprint
1023*a1a3b679SAndreas BoehlerRECURRENCE-ID:20140724T120000Z
1024*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
1025*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=ACCEPTED;CN=One:mailto:one@example.org
1026*a1a3b679SAndreas BoehlerEND:VEVENT
1027*a1a3b679SAndreas BoehlerEND:VCALENDAR
1028*a1a3b679SAndreas BoehlerICS
1029*a1a3b679SAndreas Boehler
1030*a1a3b679SAndreas Boehler            ),
1031*a1a3b679SAndreas Boehler
1032*a1a3b679SAndreas Boehler        );
1033*a1a3b679SAndreas Boehler
1034*a1a3b679SAndreas Boehler        $result = $this->parse($oldMessage, $newMessage, $expected);
1035*a1a3b679SAndreas Boehler
1036*a1a3b679SAndreas Boehler    }
1037*a1a3b679SAndreas Boehler
1038*a1a3b679SAndreas Boehler    /**
1039*a1a3b679SAndreas Boehler     * A party crasher is an attendee that accepted an event, but was not in
1040*a1a3b679SAndreas Boehler     * any original invite.
1041*a1a3b679SAndreas Boehler     *
1042*a1a3b679SAndreas Boehler     * @depends testAccepted
1043*a1a3b679SAndreas Boehler     */
1044*a1a3b679SAndreas Boehler    function testPartyCrasher() {
1045*a1a3b679SAndreas Boehler
1046*a1a3b679SAndreas Boehler        $oldMessage = <<<ICS
1047*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
1048*a1a3b679SAndreas BoehlerVERSION:2.0
1049*a1a3b679SAndreas BoehlerBEGIN:VEVENT
1050*a1a3b679SAndreas BoehlerUID:foobar
1051*a1a3b679SAndreas BoehlerSUMMARY:B-day party
1052*a1a3b679SAndreas BoehlerSEQUENCE:1
1053*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
1054*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z
1055*a1a3b679SAndreas BoehlerRRULE:FREQ=DAILY
1056*a1a3b679SAndreas BoehlerEND:VEVENT
1057*a1a3b679SAndreas BoehlerBEGIN:VEVENT
1058*a1a3b679SAndreas BoehlerUID:foobar
1059*a1a3b679SAndreas BoehlerRECURRENCE-ID:20140717T120000Z
1060*a1a3b679SAndreas BoehlerSUMMARY:B-day party
1061*a1a3b679SAndreas BoehlerSEQUENCE:1
1062*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
1063*a1a3b679SAndreas BoehlerDTSTART:20140717T120000Z
1064*a1a3b679SAndreas BoehlerRRULE:FREQ=DAILY
1065*a1a3b679SAndreas BoehlerEND:VEVENT
1066*a1a3b679SAndreas BoehlerEND:VCALENDAR
1067*a1a3b679SAndreas BoehlerICS;
1068*a1a3b679SAndreas Boehler
1069*a1a3b679SAndreas Boehler
1070*a1a3b679SAndreas Boehler        $newMessage = <<<ICS
1071*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
1072*a1a3b679SAndreas BoehlerVERSION:2.0
1073*a1a3b679SAndreas BoehlerBEGIN:VEVENT
1074*a1a3b679SAndreas BoehlerUID:foobar
1075*a1a3b679SAndreas BoehlerSUMMARY:B-day party
1076*a1a3b679SAndreas BoehlerSEQUENCE:1
1077*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
1078*a1a3b679SAndreas BoehlerDTSTART:20140716T120000Z
1079*a1a3b679SAndreas BoehlerRRULE:FREQ=DAILY
1080*a1a3b679SAndreas BoehlerEND:VEVENT
1081*a1a3b679SAndreas BoehlerBEGIN:VEVENT
1082*a1a3b679SAndreas BoehlerUID:foobar
1083*a1a3b679SAndreas BoehlerRECURRENCE-ID:20140717T120000Z
1084*a1a3b679SAndreas BoehlerSUMMARY:B-day party
1085*a1a3b679SAndreas BoehlerSEQUENCE:1
1086*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
1087*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=ACCEPTED;CN=One:mailto:one@example.org
1088*a1a3b679SAndreas BoehlerDTSTART:20140717T120000Z
1089*a1a3b679SAndreas BoehlerRRULE:FREQ=DAILY
1090*a1a3b679SAndreas BoehlerEND:VEVENT
1091*a1a3b679SAndreas BoehlerEND:VCALENDAR
1092*a1a3b679SAndreas BoehlerICS;
1093*a1a3b679SAndreas Boehler
1094*a1a3b679SAndreas Boehler        $version = \Sabre\VObject\Version::VERSION;
1095*a1a3b679SAndreas Boehler
1096*a1a3b679SAndreas Boehler        $expected = array(
1097*a1a3b679SAndreas Boehler            array(
1098*a1a3b679SAndreas Boehler                'uid' => 'foobar',
1099*a1a3b679SAndreas Boehler                'method' => 'REPLY',
1100*a1a3b679SAndreas Boehler                'component' => 'VEVENT',
1101*a1a3b679SAndreas Boehler                'sender' => 'mailto:one@example.org',
1102*a1a3b679SAndreas Boehler                'senderName' => 'One',
1103*a1a3b679SAndreas Boehler                'recipient' => 'mailto:strunk@example.org',
1104*a1a3b679SAndreas Boehler                'recipientName' => 'Strunk',
1105*a1a3b679SAndreas Boehler                'message' => <<<ICS
1106*a1a3b679SAndreas BoehlerBEGIN:VCALENDAR
1107*a1a3b679SAndreas BoehlerVERSION:2.0
1108*a1a3b679SAndreas BoehlerCALSCALE:GREGORIAN
1109*a1a3b679SAndreas BoehlerMETHOD:REPLY
1110*a1a3b679SAndreas BoehlerBEGIN:VEVENT
1111*a1a3b679SAndreas BoehlerUID:foobar
1112*a1a3b679SAndreas BoehlerSEQUENCE:1
1113*a1a3b679SAndreas BoehlerDTSTART:20140717T120000Z
1114*a1a3b679SAndreas BoehlerSUMMARY:B-day party
1115*a1a3b679SAndreas BoehlerRECURRENCE-ID:20140717T120000Z
1116*a1a3b679SAndreas BoehlerORGANIZER;CN=Strunk:mailto:strunk@example.org
1117*a1a3b679SAndreas BoehlerATTENDEE;PARTSTAT=ACCEPTED;CN=One:mailto:one@example.org
1118*a1a3b679SAndreas BoehlerEND:VEVENT
1119*a1a3b679SAndreas BoehlerEND:VCALENDAR
1120*a1a3b679SAndreas Boehler
1121*a1a3b679SAndreas BoehlerICS
1122*a1a3b679SAndreas Boehler
1123*a1a3b679SAndreas Boehler            ),
1124*a1a3b679SAndreas Boehler
1125*a1a3b679SAndreas Boehler        );
1126*a1a3b679SAndreas Boehler
1127*a1a3b679SAndreas Boehler        $result = $this->parse($oldMessage, $newMessage, $expected);
1128*a1a3b679SAndreas Boehler
1129*a1a3b679SAndreas Boehler    }
1130*a1a3b679SAndreas Boehler}
1131