1: <?php
2:
3: /**
4: * Avisota newsletter and mailing system
5: *
6: * PHP Version 5.3
7: *
8: * @copyright bit3 UG 2013
9: * @author Tristan Lins <tristan.lins@bit3.de>
10: * @package avisota-core
11: * @license LGPL-3.0+
12: * @link http://avisota.org
13: */
14:
15: namespace Avisota\Test\Message;
16:
17: use Avisota\Message\MessageInterface;
18:
19: class TestMessage implements MessageInterface
20: {
21: protected $text;
22:
23: function __construct()
24: {
25: $this->text = "This is a unit test message.\r\n";
26: $this->text .= "timestamp: " . date('Y-m-d H:i:s') . "\r\n";
27: $this->text .= "random content: " . mt_rand() . "\r\n";
28: }
29:
30: /**
31: * @return string
32: */
33: public function getText()
34: {
35: return $this->text;
36: }
37:
38: /**
39: * @return array
40: */
41: public function getRecipients()
42: {
43: return array('unittest@avisota.org');
44: }
45:
46: /**
47: * {@inheritdoc}
48: */
49: public function getRecipientDetails()
50: {
51: return array(
52: 'firstname' => 'Unit',
53: 'surname' => 'Text',
54: 'email' => 'unittest@avisota.org',
55: );
56: }
57:
58: /**
59: * {@inheritdoc}
60: */
61: public function getCopyRecipients()
62: {
63: return array();
64: }
65:
66: /**
67: * {@inheritdoc}
68: */
69: public function getBlindCopyRecipients()
70: {
71: return array();
72: }
73:
74: /**
75: * {@inheritdoc}
76: */
77: public function getFrom()
78: {
79: return 'unittest@avisota.org';
80: }
81:
82: /**
83: * {@inheritdoc}
84: */
85: public function getSender()
86: {
87: return '';
88: }
89:
90: /**
91: * {@inheritdoc}
92: */
93: public function getReplyTo()
94: {
95: return '';
96: }
97:
98: /**
99: * {@inheritdoc}
100: */
101: public function getSubject()
102: {
103: return 'Unit Test test message';
104: }
105:
106: /**
107: * {@inheritdoc}
108: */
109: public function serialize()
110: {
111: return $this->text;
112: }
113:
114: /**
115: * {@inheritdoc}
116: */
117: public function unserialize($serialized)
118: {
119: $this->text = $serialized;
120: }
121: }
122: