Completed
Push — master ( ea7ce0...85ac75 )
by Peter
06:16 queued 13s
created

EnumTest::invalidDataProvider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Klamius\Enum\Tests;
4
5
use Klamius\Enum\Tests\Fixtures\FixtureEnum;
6
7
class EnumTest extends \PHPUnit\Framework\TestCase
8
{
9
    /**
10
     * @dataProvider invalidDataProvider
11
     * @expectedException \InvalidArgumentException
12
     * @expectedExceptionMessage is not part from Klamius\Enum\Tests\Fixtures\FixtureEnum class
13
     */
14
    public function testCreatingEnumWithNotExistingValue($value)
15
    {
16
        new FixtureEnum($value);
17
    }
18
19
    public function invalidDataProvider()
20
    {
21
        return array(
22
            array(null),
23
            array(2000)
24
        );
25
    }
26
27
    public function testCreatingEnumWithExistingValue()
28
    {
29
        $this->assertEquals("string", new FixtureEnum(FixtureEnum::STRING));
30
        $this->assertEquals("2018", new FixtureEnum(FixtureEnum::NUMBER));
31
    }
32
}
33