]> git.mxchange.org Git - friendica.git/blob - tests/Util/SampleMailBuilder.php
Merge pull request #8215 from nupplaphil/task/extract_email
[friendica.git] / tests / Util / SampleMailBuilder.php
1 <?php
2
3 namespace Friendica\Test\Util;
4
5 use Friendica\Util\EMailer\MailBuilder;
6
7 class SampleMailBuilder extends MailBuilder
8 {
9         /** @var string */
10         protected $subject;
11         /** @var string */
12         protected $html;
13         /** @var string */
14         protected $text;
15
16         /**
17          * Adds a test message
18          *
19          * @param string $subject The subject of the email
20          * @param string $html    The preamble of the email
21          * @param string $text    The body of the email (if not set, the preamble will get used as body)
22          *
23          * @return static
24          */
25         public function withMessage(string $subject, string $html, string $text)
26         {
27                 $this->subject = $subject;
28                 $this->html    = $html;
29                 $this->text    = $text;
30
31                 return $this;
32         }
33
34         /**
35          * @inheritDoc
36          */
37         protected function getSubject()
38         {
39                 return $this->subject;
40         }
41
42         /**
43          * @inheritDoc
44          */
45         protected function getHtmlMessage()
46         {
47                 return $this->html;
48         }
49
50         /**
51          * @inheritDoc
52          */
53         protected function getPlaintextMessage()
54         {
55                 return $this->text;
56         }
57 }