Mercurial > hg > rc1
comparison vendor/sabre/vobject/tests/VObject/ITip/BrokerProcessMessageTest.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 BrokerProcessMessageTest extends BrokerTester { | |
6 | |
7 function testRequestNew() { | |
8 | |
9 $itip = <<<ICS | |
10 BEGIN:VCALENDAR | |
11 VERSION:2.0 | |
12 METHOD:REQUEST | |
13 BEGIN:VEVENT | |
14 SEQUENCE:1 | |
15 UID:foobar | |
16 END:VEVENT | |
17 END:VCALENDAR | |
18 ICS; | |
19 | |
20 $expected = <<<ICS | |
21 BEGIN:VCALENDAR | |
22 %foo% | |
23 BEGIN:VEVENT | |
24 SEQUENCE:1 | |
25 UID:foobar | |
26 END:VEVENT | |
27 END:VCALENDAR | |
28 ICS; | |
29 | |
30 $result = $this->process($itip, null, $expected); | |
31 | |
32 } | |
33 | |
34 function testRequestUpdate() { | |
35 | |
36 $itip = <<<ICS | |
37 BEGIN:VCALENDAR | |
38 VERSION:2.0 | |
39 METHOD:REQUEST | |
40 BEGIN:VEVENT | |
41 SEQUENCE:2 | |
42 UID:foobar | |
43 END:VEVENT | |
44 END:VCALENDAR | |
45 ICS; | |
46 | |
47 $old = <<<ICS | |
48 BEGIN:VCALENDAR | |
49 %foo% | |
50 BEGIN:VEVENT | |
51 SEQUENCE:1 | |
52 UID:foobar | |
53 END:VEVENT | |
54 END:VCALENDAR | |
55 ICS; | |
56 | |
57 $expected = <<<ICS | |
58 BEGIN:VCALENDAR | |
59 %foo% | |
60 BEGIN:VEVENT | |
61 SEQUENCE:2 | |
62 UID:foobar | |
63 END:VEVENT | |
64 END:VCALENDAR | |
65 ICS; | |
66 | |
67 $result = $this->process($itip, $old, $expected); | |
68 | |
69 } | |
70 | |
71 function testCancel() { | |
72 | |
73 $itip = <<<ICS | |
74 BEGIN:VCALENDAR | |
75 VERSION:2.0 | |
76 METHOD:CANCEL | |
77 BEGIN:VEVENT | |
78 SEQUENCE:2 | |
79 UID:foobar | |
80 END:VEVENT | |
81 END:VCALENDAR | |
82 ICS; | |
83 | |
84 $old = <<<ICS | |
85 BEGIN:VCALENDAR | |
86 %foo% | |
87 BEGIN:VEVENT | |
88 SEQUENCE:1 | |
89 UID:foobar | |
90 END:VEVENT | |
91 END:VCALENDAR | |
92 ICS; | |
93 | |
94 $expected = <<<ICS | |
95 BEGIN:VCALENDAR | |
96 %foo% | |
97 BEGIN:VEVENT | |
98 SEQUENCE:2 | |
99 UID:foobar | |
100 STATUS:CANCELLED | |
101 END:VEVENT | |
102 END:VCALENDAR | |
103 ICS; | |
104 | |
105 $result = $this->process($itip, $old, $expected); | |
106 | |
107 } | |
108 | |
109 function testCancelNoExistingEvent() { | |
110 | |
111 $itip = <<<ICS | |
112 BEGIN:VCALENDAR | |
113 VERSION:2.0 | |
114 METHOD:CANCEL | |
115 BEGIN:VEVENT | |
116 SEQUENCE:2 | |
117 UID:foobar | |
118 END:VEVENT | |
119 END:VCALENDAR | |
120 ICS; | |
121 | |
122 $old = null; | |
123 $expected = null; | |
124 | |
125 $result = $this->process($itip, $old, $expected); | |
126 | |
127 } | |
128 | |
129 function testUnsupportedComponent() { | |
130 | |
131 $itip = <<<ICS | |
132 BEGIN:VCALENDAR | |
133 VERSION:2.0 | |
134 BEGIN:VTODO | |
135 SEQUENCE:2 | |
136 UID:foobar | |
137 END:VTODO | |
138 END:VCALENDAR | |
139 ICS; | |
140 | |
141 $old = null; | |
142 $expected = null; | |
143 | |
144 $result = $this->process($itip, $old, $expected); | |
145 | |
146 } | |
147 | |
148 function testUnsupportedMethod() { | |
149 | |
150 $itip = <<<ICS | |
151 BEGIN:VCALENDAR | |
152 VERSION:2.0 | |
153 METHOD:PUBLISH | |
154 BEGIN:VEVENT | |
155 SEQUENCE:2 | |
156 UID:foobar | |
157 END:VEVENT | |
158 END:VCALENDAR | |
159 ICS; | |
160 | |
161 $old = null; | |
162 $expected = null; | |
163 | |
164 $result = $this->process($itip, $old, $expected); | |
165 | |
166 } | |
167 | |
168 } |