annotate vendor/sabre/vobject/tests/VObject/ITip/BrokerDeleteEventTest.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 BrokerDeleteEventTest 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 testOrganizerDelete() {
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=One:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
18 ATTENDEE;CN=Two:mailto:two@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
19 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
20 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
21 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
22 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
23
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
24
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
25 $newMessage = null;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
26
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
27 $version = \Sabre\VObject\Version::VERSION;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
28
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
29 $expected = array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
30 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
31 'uid' => 'foobar',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
32 'method' => 'CANCEL',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
33 'component' => 'VEVENT',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
34 'sender' => 'mailto:strunk@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
35 'senderName' => 'Strunk',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
36 'recipient' => 'mailto:one@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
37 'recipientName' => 'One',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
38 'message' => <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
39 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
40 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
41 PRODID:-//Sabre//Sabre VObject $version//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
42 CALSCALE:GREGORIAN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
43 METHOD:CANCEL
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
44 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
45 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
46 SEQUENCE:2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
47 SUMMARY:foo
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
48 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
49 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
50 ATTENDEE;CN=One:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
51 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
52 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
53 ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
54 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
55
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
56 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
57 'uid' => 'foobar',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
58 'method' => 'CANCEL',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
59 'component' => 'VEVENT',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
60 'sender' => 'mailto:strunk@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
61 'senderName' => 'Strunk',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
62 'recipient' => 'mailto:two@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
63 'recipientName' => 'Two',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
64 'message' => <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
65 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
66 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
67 PRODID:-//Sabre//Sabre VObject $version//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
68 CALSCALE:GREGORIAN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
69 METHOD:CANCEL
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
70 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
71 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
72 SEQUENCE:2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
73 SUMMARY:foo
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
74 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
75 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
76 ATTENDEE;CN=Two:mailto:two@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
77 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
78 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
79 ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
80
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
81 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
82 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
83
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
84 $result = $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
85
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
86 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
87
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
88 function testAttendeeDelete() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
89
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
90 $oldMessage = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
91 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
92 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
93 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
94 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
95 SEQUENCE:1
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
96 SUMMARY:foo
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
97 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
98 ATTENDEE;CN=One:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
99 ATTENDEE;CN=Two:mailto:two@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
100 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
101 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
102 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
103 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
104
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
105
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
106 $newMessage = null;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
107
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
108 $version = \Sabre\VObject\Version::VERSION;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
109
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
110 $expected = array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
111 array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
112 'uid' => 'foobar',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
113 'method' => 'REPLY',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
114 'component' => 'VEVENT',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
115 'sender' => 'mailto:one@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
116 'senderName' => 'One',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
117 'recipient' => 'mailto:strunk@example.org',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
118 'recipientName' => 'Strunk',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
119 'message' => <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
120 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
121 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
122 PRODID:-//Sabre//Sabre VObject $version//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
123 CALSCALE:GREGORIAN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
124 METHOD:REPLY
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
125 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
126 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
127 SEQUENCE:1
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
128 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
129 SUMMARY:foo
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
130 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
131 ATTENDEE;PARTSTAT=DECLINED;CN=One:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
132 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
133 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
134 ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
135 ),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
136 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
137
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
138 $result = $this->parse($oldMessage, $newMessage, $expected, 'mailto:one@example.org');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
139
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
140
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
141 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
142
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
143 function testAttendeeDeleteCancelledEvent() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
144
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
145 $oldMessage = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
146 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
147 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
148 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
149 STATUS:CANCELLED
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
150 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
151 SEQUENCE:1
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
152 ORGANIZER;CN=Strunk:mailto:strunk@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
153 ATTENDEE;CN=One:mailto:one@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
154 ATTENDEE;CN=Two:mailto:two@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
155 DTSTART:20140716T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
156 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
157 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
158 ICS;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
159
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
160
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
161 $newMessage = null;
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
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
167 $result = $this->parse($oldMessage, $newMessage, $expected, 'mailto:one@example.org');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
168
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
169
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
170 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
171
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
172 function testNoCalendar() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
173
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
174 $this->parse(null, null, array(), 'mailto:one@example.org');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
175
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
176 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
177
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
178 function testVTodo() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
179
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
180 $oldMessage = <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
181 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
182 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
183 BEGIN:VTODO
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
184 UID:foobar
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
185 SEQUENCE:1
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
186 END:VTODO
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 $this->parse($oldMessage, null, array(), 'mailto:one@example.org');
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 }