1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Hautzi\SystemMailBundle\SystemMailer; |
4
|
|
|
|
5
|
|
|
class ParsedMessageTest extends \PHPUnit_Framework_TestCase |
6
|
|
|
{ |
7
|
|
|
public function testGettersAndSetters() |
8
|
|
|
{ |
9
|
|
|
$fixture = new ParsedMessage(); |
10
|
|
|
|
11
|
|
|
$this->assertEmpty($fixture->getFrom()); |
12
|
|
|
$fixture->setFrom('[email protected]', 'user'); |
13
|
|
|
$this->assertEquals(['[email protected]' => 'user'], $fixture->getFrom()); |
14
|
|
|
|
15
|
|
|
$this->assertEmpty($fixture->getTo()); |
16
|
|
|
$fixture->addTo('[email protected]', 'user1'); |
17
|
|
|
$this->assertEquals(['[email protected]' => 'user1'], $fixture->getTo()); |
18
|
|
|
$fixture->addTo('[email protected]', 'user2'); |
19
|
|
|
$this->assertEquals(['[email protected]' => 'user1', '[email protected]' => 'user2',], $fixture->getTo()); |
20
|
|
|
|
21
|
|
|
$this->assertEmpty($fixture->getCc()); |
22
|
|
|
$fixture->addCc('[email protected]', 'user1'); |
23
|
|
|
$this->assertEquals(['[email protected]' => 'user1'], $fixture->getCc()); |
24
|
|
|
$fixture->addCc('[email protected]', 'user2'); |
25
|
|
|
$this->assertEquals(['[email protected]' => 'user1', '[email protected]' => 'user2',], $fixture->getCc()); |
26
|
|
|
|
27
|
|
|
$this->assertEmpty($fixture->getBcc()); |
28
|
|
|
$fixture->addBcc('[email protected]', 'user1'); |
29
|
|
|
$this->assertEquals(['[email protected]' => 'user1'], $fixture->getBcc()); |
30
|
|
|
$fixture->addBcc('[email protected]', 'user2'); |
31
|
|
|
$this->assertEquals(['[email protected]' => 'user1', '[email protected]' => 'user2',], $fixture->getBcc()); |
32
|
|
|
|
33
|
|
|
$this->assertEmpty($fixture->getReplyTo()); |
34
|
|
|
$fixture->setReplyTo('[email protected]'); |
35
|
|
|
$this->assertEquals('[email protected]', $fixture->getReplyTo()); |
36
|
|
|
|
37
|
|
|
$this->assertEmpty($fixture->getSubject()); |
38
|
|
|
$fixture->setSubject('_subject'); |
39
|
|
|
$this->assertEquals('_subject', $fixture->getSubject()); |
40
|
|
|
|
41
|
|
|
$this->assertEmpty($fixture->getMessageText()); |
42
|
|
|
$fixture->setMessageText('message'); |
43
|
|
|
$this->assertEquals('message', $fixture->getMessageText()); |
44
|
|
|
|
45
|
|
|
$this->assertEmpty($fixture->getMessageHtml()); |
46
|
|
|
$fixture->setMessageHtml('message'); |
47
|
|
|
$this->assertEquals('message', $fixture->getMessageHtml()); |
48
|
|
|
} |
49
|
|
|
} |
50
|
|
|
|