1<?php
2
3namespace Sabre\CalDAV\Schedule\IMip;
4
5/**
6 * iMIP handler.
7 *
8 * This class is responsible for sending out iMIP messages. iMIP is the
9 * email-based transport for iTIP. iTIP deals with scheduling operations for
10 * iCalendar objects.
11 *
12 * If you want to customize the email that gets sent out, you can do so by
13 * extending this class and overriding the sendMessage method.
14 *
15 * @copyright Copyright (C) 2007-2015 fruux GmbH (https://fruux.com/).
16 * @author Evert Pot (http://evertpot.com/)
17 * @license http://sabre.io/license/ Modified BSD License
18 */
19class MockPlugin extends \Sabre\CalDAV\Schedule\IMipPlugin {
20
21    protected $emails = array();
22
23    /**
24     * This function is reponsible for sending the actual email.
25     *
26     * @param string $to Recipient email address
27     * @param string $subject Subject of the email
28     * @param string $body iCalendar body
29     * @param array $headers List of headers
30     * @return void
31     */
32    protected function mail($to, $subject, $body, array $headers) {
33
34        $this->emails[] = array(
35            'to' => $to,
36            'subject' => $subject,
37            'body' => $body,
38            'headers' => $headers,
39        );
40
41    }
42
43    public function getSentEmails() {
44
45        return $this->emails;
46
47    }
48
49
50}
51