annotate vendor/sabre/vobject/tests/VObject/ITip/BrokerUpdateEventTest.php @ 7:430dbd5346f7

vendor sabre as distributed
author Charlie Root
date Sat, 13 Jan 2018 09:06:10 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
1 <?php
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
3 namespace Sabre\VObject\ITip;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
4
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
5 class BrokerUpdateTest extends BrokerTester {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
6
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
7 function testInviteChange() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
8
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
9 $oldMessage = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
10 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
11 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
12 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
13 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
14 SEQUENCE:1
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
15 SUMMARY:foo
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
16 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
17 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
18 ATTENDEE;CN=One:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
19 ATTENDEE;CN=Two:mailto:two@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
20 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
21 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
22 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
23 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
24
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
25
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
26 $newMessage = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
27 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
28 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
29 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
30 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
31 SEQUENCE:2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
32 SUMMARY:foo
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
33 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
34 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
35 ATTENDEE;CN=Two:mailto:two@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
36 ATTENDEE;CN=Three:mailto:three@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
37 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
38 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
39 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
40 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
41
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
42 $version = \Sabre\VObject\Version::VERSION;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
43
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
44 $expected = array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
45 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
46 'uid' => 'foobar',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
47 'method' => 'CANCEL',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
48 'component' => 'VEVENT',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
49 'sender' => 'mailto:strunk@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
50 'senderName' => 'Strunk',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
51 'recipient' => 'mailto:one@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
52 'recipientName' => 'One',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
53 'significantChange' => true,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
54 'message' => <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
55 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
56 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
57 PRODID:-//Sabre//Sabre VObject $version//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
58 CALSCALE:GREGORIAN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
59 METHOD:CANCEL
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
60 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
61 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
62 SEQUENCE:2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
63 SUMMARY:foo
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
64 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
65 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
66 ATTENDEE;CN=One:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
67 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
68 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
69 ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
70
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
71 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
72 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
73 'uid' => 'foobar',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
74 'method' => 'REQUEST',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
75 'component' => 'VEVENT',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
76 'sender' => 'mailto:strunk@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
77 'senderName' => 'Strunk',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
78 'recipient' => 'mailto:two@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
79 'recipientName' => 'Two',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
80 'significantChange' => false,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
81 'message' => <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
82 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
83 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
84 PRODID:-//Sabre//Sabre VObject $version//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
85 CALSCALE:GREGORIAN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
86 METHOD:REQUEST
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
87 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
88 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
89 SEQUENCE:2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
90 SUMMARY:foo
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
91 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
92 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
93 ATTENDEE;CN=Two;PARTSTAT=NEEDS-ACTION:mailto:two@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
94 ATTENDEE;CN=Three;PARTSTAT=NEEDS-ACTION:mailto:three@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
95 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
96 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
97 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
98 ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
99
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
100 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
101 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
102 'uid' => 'foobar',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
103 'method' => 'REQUEST',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
104 'component' => 'VEVENT',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
105 'sender' => 'mailto:strunk@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
106 'senderName' => 'Strunk',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
107 'recipient' => 'mailto:three@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
108 'recipientName' => 'Three',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
109 'significantChange' => true,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
110 'message' => <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
111 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
112 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
113 PRODID:-//Sabre//Sabre VObject $version//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
114 CALSCALE:GREGORIAN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
115 METHOD:REQUEST
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
116 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
117 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
118 SEQUENCE:2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
119 SUMMARY:foo
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
120 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
121 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
122 ATTENDEE;CN=Two;PARTSTAT=NEEDS-ACTION:mailto:two@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
123 ATTENDEE;CN=Three;PARTSTAT=NEEDS-ACTION:mailto:three@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
124 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
125 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
126 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
127 ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
128
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
129 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
130 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
131
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
132 $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
133
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
134 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
135
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
136 function testInviteChangeFromNonSchedulingToSchedulingObject() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
137
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
138 $oldMessage = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
139 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
140 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
141 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
142 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
143 SEQUENCE:1
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
144 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
145 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
146 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
147 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
148
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
149
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
150 $newMessage = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
151 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
152 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
153 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
154 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
155 SEQUENCE:2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
156 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
157 ATTENDEE;CN=One:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
158 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
159 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
160 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
161 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
162
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
163 $version = \Sabre\VObject\Version::VERSION;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
164
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
165 $expected = array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
166 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
167 'uid' => 'foobar',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
168 'method' => 'REQUEST',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
169 'component' => 'VEVENT',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
170 'sender' => 'mailto:strunk@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
171 'senderName' => 'Strunk',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
172 'recipient' => 'mailto:one@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
173 'recipientName' => 'One',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
174 'message' => <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
175 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
176 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
177 PRODID:-//Sabre//Sabre VObject $version//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
178 CALSCALE:GREGORIAN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
179 METHOD:REQUEST
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
180 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
181 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
182 SEQUENCE:2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
183 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
184 ATTENDEE;CN=One;PARTSTAT=NEEDS-ACTION:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
185 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
186 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
187 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
188 ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
189
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
190 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
191
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
192 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
193
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
194 $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
195
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
196 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
197
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
198 function testInviteChangeFromSchedulingToNonSchedulingObject() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
199
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
200 $oldMessage = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
201 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
202 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
203 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
204 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
205 SEQUENCE:2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
206 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
207 ATTENDEE;CN=One:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
208 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
209 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
210 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
211 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
212
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
213
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
214 $newMessage = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
215 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
216 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
217 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
218 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
219 SEQUENCE:1
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
220 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
221 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
222 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
223 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
224
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
225 $version = \Sabre\VObject\Version::VERSION;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
226
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
227 $expected = array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
228 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
229 'uid' => 'foobar',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
230 'method' => 'CANCEL',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
231 'component' => 'VEVENT',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
232 'message' => <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
233 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
234 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
235 PRODID:-//Sabre//Sabre VObject $version//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
236 CALSCALE:GREGORIAN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
237 METHOD:CANCEL
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
238 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
239 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
240 SEQUENCE:1
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
241 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
242 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
243 ATTENDEE;CN=One:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
244 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
245 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
246 ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
247
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
248 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
249
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
250 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
251
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
252 $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
253
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
254 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
255
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
256 function testNoAttendees() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
257
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
258 $oldMessage = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
259 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
260 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
261 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
262 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
263 SEQUENCE:1
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
264 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
265 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
266 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
267 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
268
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
269
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
270 $newMessage = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
271 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
272 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
273 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
274 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
275 SEQUENCE:2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
276 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
277 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
278 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
279 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
280
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
281 $version = \Sabre\VObject\Version::VERSION;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
282
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
283 $expected = array();
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
284 $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
285
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
286 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
287
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
288 function testRemoveInstance() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
289
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
290 $oldMessage = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
291 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
292 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
293 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
294 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
295 SEQUENCE:1
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
296 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
297 ATTENDEE;CN=One:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
298 DTSTART;TZID=America/Toronto:20140716T120000
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
299 RRULE:FREQ=WEEKLY
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
300 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
301 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
302 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
303
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
304
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
305 $newMessage = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
306 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
307 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
308 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
309 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
310 SEQUENCE:2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
311 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
312 ATTENDEE;CN=One:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
313 DTSTART;TZID=America/Toronto:20140716T120000
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
314 RRULE:FREQ=WEEKLY
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
315 EXDATE;TZID=America/Toronto:20140724T120000
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
316 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
317 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
318 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
319
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
320 $version = \Sabre\VObject\Version::VERSION;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
321
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
322 $expected = array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
323 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
324 'uid' => 'foobar',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
325 'method' => 'REQUEST',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
326 'component' => 'VEVENT',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
327 'sender' => 'mailto:strunk@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
328 'senderName' => 'Strunk',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
329 'recipient' => 'mailto:one@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
330 'recipientName' => 'One',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
331 'message' => <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
332 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
333 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
334 PRODID:-//Sabre//Sabre VObject $version//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
335 CALSCALE:GREGORIAN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
336 METHOD:REQUEST
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
337 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
338 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
339 SEQUENCE:2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
340 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
341 ATTENDEE;CN=One;PARTSTAT=NEEDS-ACTION:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
342 DTSTART;TZID=America/Toronto:20140716T120000
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
343 RRULE:FREQ=WEEKLY
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
344 EXDATE;TZID=America/Toronto:20140724T120000
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
345 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
346 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
347 ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
348
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
349 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
350 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
351
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
352 $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
353
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
354 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
355
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
356 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
357 * This test is identical to the first test, except this time we change the
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
358 * DURATION property.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
359 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
360 * This should ensure that the message is significant for every attendee,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
361 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
362 function testInviteChangeSignificantChange() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
363
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
364 $oldMessage = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
365 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
366 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
367 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
368 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
369 DURATION:PT1H
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
370 SEQUENCE:1
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
371 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
372 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
373 ATTENDEE;CN=One:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
374 ATTENDEE;CN=Two:mailto:two@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
375 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
376 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
377 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
378 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
379
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
380
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
381 $newMessage = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
382 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
383 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
384 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
385 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
386 DURATION:PT2H
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
387 SEQUENCE:2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
388 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
389 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
390 ATTENDEE;CN=Two:mailto:two@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
391 ATTENDEE;CN=Three:mailto:three@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
392 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
393 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
394 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
395 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
396
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
397 $version = \Sabre\VObject\Version::VERSION;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
398
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
399 $expected = array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
400 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
401 'uid' => 'foobar',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
402 'method' => 'CANCEL',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
403 'component' => 'VEVENT',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
404 'sender' => 'mailto:strunk@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
405 'senderName' => 'Strunk',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
406 'recipient' => 'mailto:one@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
407 'recipientName' => 'One',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
408 'significantChange' => true,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
409 'message' => <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
410 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
411 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
412 PRODID:-//Sabre//Sabre VObject $version//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
413 CALSCALE:GREGORIAN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
414 METHOD:CANCEL
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
415 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
416 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
417 SEQUENCE:2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
418 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
419 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
420 ATTENDEE;CN=One:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
421 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
422 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
423 ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
424
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
425 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
426 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
427 'uid' => 'foobar',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
428 'method' => 'REQUEST',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
429 'component' => 'VEVENT',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
430 'sender' => 'mailto:strunk@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
431 'senderName' => 'Strunk',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
432 'recipient' => 'mailto:two@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
433 'recipientName' => 'Two',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
434 'significantChange' => true,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
435 'message' => <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
436 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
437 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
438 PRODID:-//Sabre//Sabre VObject $version//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
439 CALSCALE:GREGORIAN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
440 METHOD:REQUEST
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
441 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
442 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
443 DURATION:PT2H
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
444 SEQUENCE:2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
445 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
446 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
447 ATTENDEE;CN=Two;PARTSTAT=NEEDS-ACTION:mailto:two@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
448 ATTENDEE;CN=Three;PARTSTAT=NEEDS-ACTION:mailto:three@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
449 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
450 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
451 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
452 ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
453
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
454 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
455 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
456 'uid' => 'foobar',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
457 'method' => 'REQUEST',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
458 'component' => 'VEVENT',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
459 'sender' => 'mailto:strunk@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
460 'senderName' => 'Strunk',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
461 'recipient' => 'mailto:three@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
462 'recipientName' => 'Three',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
463 'significantChange' => true,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
464 'message' => <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
465 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
466 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
467 PRODID:-//Sabre//Sabre VObject $version//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
468 CALSCALE:GREGORIAN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
469 METHOD:REQUEST
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
470 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
471 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
472 DURATION:PT2H
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
473 SEQUENCE:2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
474 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
475 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
476 ATTENDEE;CN=Two;PARTSTAT=NEEDS-ACTION:mailto:two@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
477 ATTENDEE;CN=Three;PARTSTAT=NEEDS-ACTION:mailto:three@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
478 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
479 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
480 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
481 ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
482
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
483 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
484 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
485
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
486 $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
487
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
488 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
489
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
490 function testInviteNoChange() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
491
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
492 $oldMessage = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
493 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
494 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
495 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
496 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
497 SEQUENCE:1
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
498 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
499 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
500 ATTENDEE;CN=One:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
501 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
502 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
503 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
504 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
505
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
506
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
507 $newMessage = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
508 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
509 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
510 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
511 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
512 SEQUENCE:2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
513 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
514 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
515 ATTENDEE;CN=One:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
516 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
517 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
518 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
519 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
520
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
521 $version = \Sabre\VObject\Version::VERSION;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
522
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
523 $expected = array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
524 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
525 'uid' => 'foobar',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
526 'method' => 'REQUEST',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
527 'component' => 'VEVENT',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
528 'sender' => 'mailto:strunk@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
529 'senderName' => 'Strunk',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
530 'recipient' => 'mailto:one@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
531 'recipientName' => 'One',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
532 'significantChange' => false,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
533 'message' => <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
534 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
535 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
536 PRODID:-//Sabre//Sabre VObject $version//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
537 CALSCALE:GREGORIAN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
538 METHOD:REQUEST
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
539 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
540 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
541 SEQUENCE:2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
542 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
543 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
544 ATTENDEE;CN=One;PARTSTAT=NEEDS-ACTION:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
545 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
546 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
547 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
548 ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
549
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
550 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
551
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
552 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
553
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
554 $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
555
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
556 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
557
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
558 function testInviteNoChangeForceSend() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
559
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
560 $oldMessage = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
561 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
562 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
563 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
564 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
565 SEQUENCE:1
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
566 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
567 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
568 ATTENDEE;CN=One:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
569 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
570 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
571 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
572 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
573
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
574
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
575 $newMessage = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
576 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
577 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
578 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
579 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
580 SEQUENCE:2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
581 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
582 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
583 ATTENDEE;SCHEDULE-FORCE-SEND=REQUEST;CN=One:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
584 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
585 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
586 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
587 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
588
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
589 $version = \Sabre\VObject\Version::VERSION;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
590
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
591 $expected = array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
592 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
593 'uid' => 'foobar',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
594 'method' => 'REQUEST',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
595 'component' => 'VEVENT',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
596 'sender' => 'mailto:strunk@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
597 'senderName' => 'Strunk',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
598 'recipient' => 'mailto:one@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
599 'recipientName' => 'One',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
600 'significantChange' => true,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
601 'message' => <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
602 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
603 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
604 PRODID:-//Sabre//Sabre VObject $version//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
605 CALSCALE:GREGORIAN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
606 METHOD:REQUEST
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
607 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
608 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
609 SEQUENCE:2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
610 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
611 ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
612 ATTENDEE;CN=One;PARTSTAT=NEEDS-ACTION:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
613 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
614 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
615 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
616 ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
617
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
618 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
619
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
620 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
621
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
622 $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
623
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
624 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
625
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
626 function testInviteRemoveAttendees() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
627
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
628 $oldMessage = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
629 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
630 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
631 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
632 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
633 SEQUENCE:1
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
634 SUMMARY:foo
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
635 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
636 ATTENDEE;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
637 ATTENDEE;CN=One:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
638 ATTENDEE;CN=Two:mailto:two@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
639 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
640 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
641 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
642 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
643
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
644
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
645 $newMessage = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
646 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
647 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
648 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
649 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
650 SEQUENCE:2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
651 SUMMARY:foo
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
652 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
653 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
654 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
655 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
656
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
657 $version = \Sabre\VObject\Version::VERSION;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
658
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
659 $expected = array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
660 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
661 'uid' => 'foobar',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
662 'method' => 'CANCEL',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
663 'component' => 'VEVENT',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
664 'sender' => 'mailto:strunk@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
665 'senderName' => 'Strunk',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
666 'recipient' => 'mailto:one@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
667 'recipientName' => 'One',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
668 'significantChange' => true,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
669 'message' => <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
670 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
671 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
672 PRODID:-//Sabre//Sabre VObject $version//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
673 CALSCALE:GREGORIAN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
674 METHOD:CANCEL
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
675 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
676 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
677 SEQUENCE:2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
678 SUMMARY:foo
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
679 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
680 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
681 ATTENDEE;CN=One:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
682 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
683 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
684 ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
685
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
686 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
687 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
688 'uid' => 'foobar',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
689 'method' => 'CANCEL',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
690 'component' => 'VEVENT',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
691 'sender' => 'mailto:strunk@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
692 'senderName' => 'Strunk',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
693 'recipient' => 'mailto:two@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
694 'recipientName' => 'Two',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
695 'significantChange' => true,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
696 'message' => <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
697 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
698 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
699 PRODID:-//Sabre//Sabre VObject $version//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
700 CALSCALE:GREGORIAN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
701 METHOD:CANCEL
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
702 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
703 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
704 SEQUENCE:2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
705 SUMMARY:foo
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
706 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
707 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
708 ATTENDEE;CN=Two:mailto:two@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
709 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
710 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
711 ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
712
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
713 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
714 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
715
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
716 $result = $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
717
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
718 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
719 }