ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\CalDAV\Schedule\IMipPluginTest Class Reference
+ Inheritance diagram for Sabre\CalDAV\Schedule\IMipPluginTest:
+ Collaboration diagram for Sabre\CalDAV\Schedule\IMipPluginTest:

Public Member Functions

 testGetPluginInfo ()
 
 testDeliverReply ()
 
 testDeliverReplyNoMailto ()
 
 testDeliverRequest ()
 
 testDeliverCancel ()
 
 schedule (Message $message)
 
 testDeliverInsignificantRequest ()
 

Detailed Description

Definition at line 9 of file IMipPluginTest.php.

Member Function Documentation

◆ schedule()

Sabre\CalDAV\Schedule\IMipPluginTest::schedule ( Message  $message)

Definition at line 178 of file IMipPluginTest.php.

178 {
179
180 $plugin = new IMip\MockPlugin('system@example.org');
181
182 $server = new Server();
183 $server->addPlugin($plugin);
184 $server->emit('schedule', [$message]);
185
186 return $plugin->getSentEmails();
187
188 }
catch(Exception $e) $message
$server
Definition: sabredav.php:48

References $message, and $server.

Referenced by Sabre\CalDAV\Schedule\IMipPluginTest\testDeliverCancel(), Sabre\CalDAV\Schedule\IMipPluginTest\testDeliverInsignificantRequest(), Sabre\CalDAV\Schedule\IMipPluginTest\testDeliverReply(), Sabre\CalDAV\Schedule\IMipPluginTest\testDeliverReplyNoMailto(), and Sabre\CalDAV\Schedule\IMipPluginTest\testDeliverRequest().

+ Here is the caller graph for this function:

◆ testDeliverCancel()

Sabre\CalDAV\Schedule\IMipPluginTest::testDeliverCancel ( )

Definition at line 135 of file IMipPluginTest.php.

135 {
136
137 $message = new Message();
138 $message->sender = 'mailto:sender@example.org';
139 $message->senderName = 'Sender';
140 $message->recipient = 'mailto:recipient@example.org';
141 $message->recipientName = 'Recipient';
142 $message->method = 'CANCEL';
143
144 $ics = <<<ICS
145BEGIN:VCALENDAR\r
146METHOD:CANCEL\r
147BEGIN:VEVENT\r
148SUMMARY:Birthday party\r
149END:VEVENT\r
150END:VCALENDAR\r
151
152ICS;
153
154
155 $message->message = Reader::read($ics);
156
157 $result = $this->schedule($message);
158
159 $expected = [
160 [
161 'to' => 'Recipient <recipient@example.org>',
162 'subject' => 'Cancelled: Birthday party',
163 'body' => $ics,
164 'headers' => [
165 'Reply-To: Sender <sender@example.org>',
166 'From: system@example.org',
167 'Content-Type: text/calendar; charset=UTF-8; method=CANCEL',
168 'X-Sabre-Version: ' . \Sabre\DAV\Version::VERSION,
169 ],
170 ]
171 ];
172
173 $this->assertEquals($expected, $result);
174 $this->assertEquals('1.1', substr($message->scheduleStatus, 0, 3));
175
176 }
$result
const VERSION
Full version number.
Definition: Version.php:17
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42

References $message, $result, Sabre\VObject\Reader\read(), Sabre\CalDAV\Schedule\IMipPluginTest\schedule(), and Sabre\DAV\Version\VERSION.

+ Here is the call graph for this function:

◆ testDeliverInsignificantRequest()

Sabre\CalDAV\Schedule\IMipPluginTest::testDeliverInsignificantRequest ( )

Definition at line 190 of file IMipPluginTest.php.

190 {
191
192 $message = new Message();
193 $message->sender = 'mailto:sender@example.org';
194 $message->senderName = 'Sender';
195 $message->recipient = 'mailto:recipient@example.org';
196 $message->recipientName = 'Recipient';
197 $message->method = 'REQUEST';
198 $message->significantChange = false;
199
200 $ics = <<<ICS
201BEGIN:VCALENDAR\r
202METHOD:REQUEST\r
203BEGIN:VEVENT\r
204SUMMARY:Birthday party\r
205END:VEVENT\r
206END:VCALENDAR\r
207
208ICS;
209
210
211 $message->message = Reader::read($ics);
212
213 $result = $this->schedule($message);
214
215 $expected = [];
216 $this->assertEquals($expected, $result);
217 $this->assertEquals('1.0', $message->getScheduleStatus()[0]);
218
219 }

References $message, $result, Sabre\VObject\Reader\read(), and Sabre\CalDAV\Schedule\IMipPluginTest\schedule().

+ Here is the call graph for this function:

◆ testDeliverReply()

Sabre\CalDAV\Schedule\IMipPluginTest::testDeliverReply ( )

Definition at line 21 of file IMipPluginTest.php.

21 {
22
23 $message = new Message();
24 $message->sender = 'mailto:sender@example.org';
25 $message->senderName = 'Sender';
26 $message->recipient = 'mailto:recipient@example.org';
27 $message->recipientName = 'Recipient';
28 $message->method = 'REPLY';
29
30 $ics = <<<ICS
31BEGIN:VCALENDAR\r
32METHOD:REPLY\r
33BEGIN:VEVENT\r
34SUMMARY:Birthday party\r
35END:VEVENT\r
36END:VCALENDAR\r
37
38ICS;
39
40
41 $message->message = Reader::read($ics);
42
43 $result = $this->schedule($message);
44
45 $expected = [
46 [
47 'to' => 'Recipient <recipient@example.org>',
48 'subject' => 'Re: Birthday party',
49 'body' => $ics,
50 'headers' => [
51 'Reply-To: Sender <sender@example.org>',
52 'From: system@example.org',
53 'Content-Type: text/calendar; charset=UTF-8; method=REPLY',
54 'X-Sabre-Version: ' . \Sabre\DAV\Version::VERSION,
55 ],
56 ]
57 ];
58
59 $this->assertEquals($expected, $result);
60
61 }

References $message, $result, Sabre\VObject\Reader\read(), Sabre\CalDAV\Schedule\IMipPluginTest\schedule(), and Sabre\DAV\Version\VERSION.

+ Here is the call graph for this function:

◆ testDeliverReplyNoMailto()

Sabre\CalDAV\Schedule\IMipPluginTest::testDeliverReplyNoMailto ( )

Definition at line 63 of file IMipPluginTest.php.

63 {
64
65 $message = new Message();
66 $message->sender = 'mailto:sender@example.org';
67 $message->senderName = 'Sender';
68 $message->recipient = 'http://example.org/recipient';
69 $message->recipientName = 'Recipient';
70 $message->method = 'REPLY';
71
72 $ics = <<<ICS
73BEGIN:VCALENDAR\r
74METHOD:REPLY\r
75BEGIN:VEVENT\r
76SUMMARY:Birthday party\r
77END:VEVENT\r
78END:VCALENDAR\r
79
80ICS;
81
82
83 $message->message = Reader::read($ics);
84
85 $result = $this->schedule($message);
86
87 $expected = [];
88
89 $this->assertEquals($expected, $result);
90
91 }

References $message, $result, Sabre\VObject\Reader\read(), and Sabre\CalDAV\Schedule\IMipPluginTest\schedule().

+ Here is the call graph for this function:

◆ testDeliverRequest()

Sabre\CalDAV\Schedule\IMipPluginTest::testDeliverRequest ( )

Definition at line 93 of file IMipPluginTest.php.

93 {
94
95 $message = new Message();
96 $message->sender = 'mailto:sender@example.org';
97 $message->senderName = 'Sender';
98 $message->recipient = 'mailto:recipient@example.org';
99 $message->recipientName = 'Recipient';
100 $message->method = 'REQUEST';
101
102 $ics = <<<ICS
103BEGIN:VCALENDAR\r
104METHOD:REQUEST\r
105BEGIN:VEVENT\r
106SUMMARY:Birthday party\r
107END:VEVENT\r
108END:VCALENDAR\r
109
110ICS;
111
112
113 $message->message = Reader::read($ics);
114
115 $result = $this->schedule($message);
116
117 $expected = [
118 [
119 'to' => 'Recipient <recipient@example.org>',
120 'subject' => 'Birthday party',
121 'body' => $ics,
122 'headers' => [
123 'Reply-To: Sender <sender@example.org>',
124 'From: system@example.org',
125 'Content-Type: text/calendar; charset=UTF-8; method=REQUEST',
126 'X-Sabre-Version: ' . \Sabre\DAV\Version::VERSION,
127 ],
128 ]
129 ];
130
131 $this->assertEquals($expected, $result);
132
133 }

References $message, $result, Sabre\VObject\Reader\read(), Sabre\CalDAV\Schedule\IMipPluginTest\schedule(), and Sabre\DAV\Version\VERSION.

+ Here is the call graph for this function:

◆ testGetPluginInfo()

Sabre\CalDAV\Schedule\IMipPluginTest::testGetPluginInfo ( )

Definition at line 11 of file IMipPluginTest.php.

11 {
12
13 $plugin = new IMipPlugin('system@example.com');
14 $this->assertEquals(
15 'imip',
16 $plugin->getPluginInfo()['name']
17 );
18
19 }

The documentation for this class was generated from the following file: