1 | <?php |
||
21 | class EnumConstantExtensionTest extends \PHPUnit_Framework_TestCase |
||
22 | { |
||
23 | /** |
||
24 | * @var EnumConstantExtension $enumConstantExtension EnumConstantExtension |
||
25 | */ |
||
26 | private $enumConstantExtension; |
||
27 | |||
28 | /** |
||
29 | * {@inheritdoc} |
||
30 | */ |
||
31 | public function setUp() |
||
42 | |||
43 | /** |
||
44 | * Test method `getName` |
||
45 | */ |
||
46 | public function testGetName() |
||
50 | |||
51 | /** |
||
52 | * Test method `getFilters` |
||
53 | */ |
||
54 | public function testGetFilters() |
||
61 | |||
62 | /** |
||
63 | * Test that method `getEnumConstant` returns expected value of ENUM constant |
||
64 | * |
||
65 | * @param string $expectedValueOfConstant Expected readable value |
||
66 | * @param string $enumConstant ENUM constant |
||
67 | * @param string $enumType ENUM type |
||
68 | * |
||
69 | * @dataProvider dataProviderForGetReadableEnumValueTest |
||
70 | */ |
||
71 | public function testGetEnumConstant($expectedValueOfConstant, $enumConstant, $enumType) |
||
78 | |||
79 | /** |
||
80 | * Data provider for method `testGetEnumValue` |
||
81 | * |
||
82 | * @return array |
||
83 | */ |
||
84 | public function dataProviderForGetReadableEnumValueTest() |
||
93 | |||
94 | /** |
||
95 | * Test that using ENUM constant extension for ENUM type that is not registered throws exception |
||
96 | * |
||
97 | * @expectedException \Fresh\DoctrineEnumBundle\Exception\EnumTypeIsNotRegisteredException |
||
98 | */ |
||
99 | public function testEnumTypeIsNotRegisteredException() |
||
103 | |||
104 | /** |
||
105 | * Test that using ENUM constant that is found in few registered ENUM types throws exception |
||
106 | * |
||
107 | * @expectedException \Fresh\DoctrineEnumBundle\Exception\ConstantIsFoundInFewRegisteredEnumTypesException |
||
108 | */ |
||
109 | public function testConstantIsFoundInFewRegisteredEnumTypesException() |
||
113 | |||
114 | /** |
||
115 | * Test that using ENUM constant that is not found in any registered ENUM type throws exception |
||
116 | * |
||
117 | * @expectedException \Fresh\DoctrineEnumBundle\Exception\ConstantIsNotFoundInAnyRegisteredEnumTypeException |
||
118 | */ |
||
119 | public function testConstantIsNotFoundInAnyRegisteredEnumTypeException() |
||
123 | |||
124 | /** |
||
125 | * Test that using ENUM constant extension without any registered ENUM type throws exception |
||
126 | * |
||
127 | * @expectedException \Fresh\DoctrineEnumBundle\Exception\NoRegisteredEnumTypesException |
||
128 | */ |
||
129 | public function testNoRegisteredEnumTypesException() |
||
135 | } |
||
136 |