ThreadStatusTest::validThreadStatusProvider()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the MilioooMessageBundle package.
5
 *
6
 * (c) Michiel boeckaert <[email protected]>
7
 * This source file is subject to the MIT license that is bundled
8
 * with this source code in the file LICENSE.
9
 */
10
11
namespace Miliooo\Messaging\Tests\ValueObjects;
12
13
use Miliooo\Messaging\ValueObjects\ThreadStatus;
14
use Miliooo\Messaging\Model\ThreadMetaInterface;
15
16
/**
17
 * Test file for Thread Status Value Object
18
 *
19
 * @author Michiel Boeckaert <[email protected]>
20
 */
21
class ThreadStatusTest extends \PHPUnit_Framework_TestCase
22
{
23
    /**
24
     * @dataProvider invalidThreadStatusProvider
25
     * @expectedException \InvalidArgumentException
26
     * @expectedExceptionMessage Invalid thread status
27
     */
28
    public function testInvalidThreadStatuses($status)
29
    {
30
        new ThreadStatus($status);
31
    }
32
33
    /**
34
     * Invalid statuses provider.
35
     *
36
     * @return array
37
     */
38
    public function invalidThreadStatusProvider()
39
    {
40
        return [
41
            ['foo'],
42
            [null],
43
            [100],
44
            [[]]
45
        ];
46
    }
47
48
    /**
49
     * Valid statuses provider.
50
     *
51
     * @return array
52
     */
53
    public function validThreadStatusProvider()
54
    {
55
        return [
56
            [ThreadMetaInterface::STATUS_ARCHIVED],
57
            [ThreadMetaInterface::STATUS_ACTIVE],
58
        ];
59
    }
60
61
    /**
62
     * @dataProvider validThreadStatusProvider
63
     */
64
    public function testValidReadStatuses($status)
65
    {
66
        $statusValueObject = new ThreadStatus($status);
67
        $this->assertEquals($status, $statusValueObject->getThreadStatus());
68
    }
69
}
70