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