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.

References $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().

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  }
$server
Definition: sabredav.php:48
catch(Exception $e) $message
+ Here is the caller graph for this function:

◆ testDeliverCancel()

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

Definition at line 135 of file IMipPluginTest.php.

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

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
145 BEGIN:VCALENDAR\r
146 METHOD:CANCEL\r
147 BEGIN:VEVENT\r
148 SUMMARY:Birthday party\r
149 END:VEVENT\r
150 END:VCALENDAR\r
151 
152 ICS;
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
catch(Exception $e) $message
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42
+ Here is the call graph for this function:

◆ testDeliverInsignificantRequest()

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

Definition at line 190 of file IMipPluginTest.php.

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

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
201 BEGIN:VCALENDAR\r
202 METHOD:REQUEST\r
203 BEGIN:VEVENT\r
204 SUMMARY:Birthday party\r
205 END:VEVENT\r
206 END:VCALENDAR\r
207 
208 ICS;
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  }
$result
catch(Exception $e) $message
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42
+ Here is the call graph for this function:

◆ testDeliverReply()

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

Definition at line 21 of file IMipPluginTest.php.

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

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
31 BEGIN:VCALENDAR\r
32 METHOD:REPLY\r
33 BEGIN:VEVENT\r
34 SUMMARY:Birthday party\r
35 END:VEVENT\r
36 END:VCALENDAR\r
37 
38 ICS;
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  }
$result
const VERSION
Full version number.
Definition: Version.php:17
catch(Exception $e) $message
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42
+ Here is the call graph for this function:

◆ testDeliverReplyNoMailto()

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

Definition at line 63 of file IMipPluginTest.php.

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

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
73 BEGIN:VCALENDAR\r
74 METHOD:REPLY\r
75 BEGIN:VEVENT\r
76 SUMMARY:Birthday party\r
77 END:VEVENT\r
78 END:VCALENDAR\r
79 
80 ICS;
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  }
$result
catch(Exception $e) $message
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42
+ Here is the call graph for this function:

◆ testDeliverRequest()

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

Definition at line 93 of file IMipPluginTest.php.

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

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
103 BEGIN:VCALENDAR\r
104 METHOD:REQUEST\r
105 BEGIN:VEVENT\r
106 SUMMARY:Birthday party\r
107 END:VEVENT\r
108 END:VCALENDAR\r
109 
110 ICS;
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  }
$result
const VERSION
Full version number.
Definition: Version.php:17
catch(Exception $e) $message
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
Definition: Reader.php:42
+ 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: