1 | <?php |
||
22 | class NewThreadSingleRecipientTest extends \PHPUnit_Framework_TestCase |
||
23 | { |
||
24 | /** |
||
25 | * The class under test. |
||
26 | * |
||
27 | * @var NewThreadSingleRecipient |
||
28 | */ |
||
29 | private $formModel; |
||
30 | |||
31 | /** |
||
32 | * A participant |
||
33 | * |
||
34 | * @var ParticipantInterface |
||
35 | */ |
||
36 | private $recipient; |
||
37 | |||
38 | |||
39 | public function setUp() |
||
40 | { |
||
41 | $this->formModel = new NewThreadSingleRecipient(); |
||
42 | $this->recipient = new ParticipantTestHelper(1); |
||
43 | } |
||
44 | |||
45 | public function testInterface() |
||
46 | { |
||
47 | $this->assertInstanceOf('Miliooo\Messaging\Form\FormModel\NewThreadInterface', $this->formModel); |
||
48 | } |
||
49 | |||
50 | public function testRecipientWorks() |
||
51 | { |
||
52 | $recipient = new ParticipantTestHelper(1); |
||
53 | $this->formModel->setRecipient($recipient); |
||
54 | $this->assertSame([$recipient], $this->formModel->getRecipients()); |
||
55 | } |
||
56 | |||
57 | public function testSubjectWorks() |
||
58 | { |
||
59 | $subject = 'this is the subject'; |
||
60 | $this->formModel->setSubject($subject); |
||
61 | $this->assertSame($subject, $this->formModel->getSubject()); |
||
62 | } |
||
63 | |||
64 | /** |
||
65 | * The form will call this function to get the recipient. |
||
66 | */ |
||
67 | public function testGetRecipientWorks() |
||
72 | |||
73 | public function testGetRecipientsReturnsArayWhenEmpty() |
||
77 | } |
||
78 |