]> git.mxchange.org Git - friendica.git/blob - tests/Util/EmailerSpy.php
Improve comment wording in ApiTest
[friendica.git] / tests / Util / EmailerSpy.php
1 <?php
2
3 namespace Friendica\Test\Util;
4
5 use Friendica\Util\Emailer;
6
7 class EmailerSpy extends Emailer
8 {
9         public static $MAIL_DATA;
10
11         /**
12          * Wrapper around the mail() method (mainly used to overwrite for tests)
13          * @see mail()
14          *
15          * @param string $to         Recipient of this mail
16          * @param string $subject    Subject of this mail
17          * @param string $body       Message body of this mail
18          * @param string $headers    Headers of this mail
19          * @param string $parameters Additional (sendmail) parameters of this mail
20          *
21          * @return bool true if the mail was successfully accepted for delivery, false otherwise.
22          */
23         protected function mail(string $to, string $subject, string $body, string $headers, string $parameters)
24         {
25                 self::$MAIL_DATA = [
26                         'to' => $to,
27                         'subject' => $subject,
28                         'body' => $body,
29                         'headers' => $headers,
30                         'parameters' => $parameters,
31                 ];
32
33                 return true;
34         }
35 }