1 | <?php |
||
22 | class ThreadMetaTest extends \PHPUnit_Framework_TestCase |
||
23 | { |
||
24 | /** |
||
25 | * The class under test |
||
26 | * |
||
27 | * @var ThreadMeta |
||
28 | */ |
||
29 | protected $threadMeta; |
||
30 | |||
31 | public function setUp() |
||
32 | { |
||
33 | $this->threadMeta = $this->getMockForAbstractClass('Miliooo\Messaging\Model\ThreadMeta'); |
||
34 | } |
||
35 | |||
36 | public function testInterface() |
||
37 | { |
||
38 | $this->assertInstanceOf('Miliooo\Messaging\Model\ThreadMetaInterface', $this->threadMeta); |
||
39 | } |
||
40 | |||
41 | public function testIdWorks() |
||
42 | { |
||
43 | $this->assertAttributeEquals(null, 'id', $this->threadMeta); |
||
44 | $this->assertNull($this->threadMeta->getId()); |
||
45 | } |
||
46 | |||
47 | public function testParticipantWorks() |
||
48 | { |
||
49 | $participant = new ParticipantTestHelper('participant'); |
||
50 | $this->threadMeta->setParticipant($participant); |
||
51 | $this->assertSame($participant, $this->threadMeta->getParticipant()); |
||
52 | } |
||
53 | |||
54 | public function testDefaultStatusIsActive() |
||
58 | |||
59 | public function testStatusWorks() |
||
64 | |||
65 | /** |
||
66 | * @expectedException \InvalidArgumentException |
||
67 | * @expectedExceptionMessage Not a valid status |
||
68 | */ |
||
69 | public function testStatusNeedsValidStatus() |
||
73 | |||
74 | public function testLastParticipantMessageDateWorks() |
||
80 | |||
81 | public function testLastMessageDateWorks() |
||
87 | |||
88 | public function testThreadWorks() |
||
94 | |||
95 | public function testUnreadMessageCountWorks() |
||
104 | } |
||
105 |