1 | <?php |
||
9 | final class AbstractEnumTest extends TestCase |
||
10 | { |
||
11 | /** |
||
12 | * @test |
||
13 | */ |
||
14 | public function enum(): void |
||
24 | |||
25 | /** |
||
26 | * @test |
||
27 | */ |
||
28 | public function null(): void |
||
34 | |||
35 | /** |
||
36 | * @test |
||
37 | */ |
||
38 | public function integer(): void |
||
44 | |||
45 | /** |
||
46 | * @test |
||
47 | */ |
||
48 | public function isShouldReturnTrueWhenComparingObjectsWithTheSameTypeAndValue(): void |
||
49 | { |
||
50 | $a = TestEnum::get(TestEnum::A); |
||
51 | |||
52 | self::assertTrue($a->isA()); |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * @test |
||
57 | */ |
||
58 | public function isShouldReturnFalseWhenComparingObjectsWithTheSameTypeAndDifferentValue(): void |
||
59 | { |
||
60 | $a = TestEnum::get(TestEnum::A); |
||
61 | |||
62 | self::assertFalse($a->isB()); |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * @test |
||
67 | */ |
||
68 | public function equalsShouldReturnTrueWhenComparingObjectsWithTheSameTypeAndValue(): void |
||
74 | |||
75 | /** |
||
76 | * @test |
||
77 | */ |
||
78 | public function equalsShouldReturnFalseWhenComparingObjectsWithTheSameTypeButDifferentValue(): void |
||
84 | |||
85 | /** |
||
86 | * @test |
||
87 | */ |
||
88 | public function equalsShouldReturnFalseWhenComparingObjectsWithTheSameValueButDifferentType(): void |
||
94 | |||
95 | /** |
||
96 | * @test |
||
97 | */ |
||
98 | public function equalsShouldReturnTrueWhenComparingObjectsWithDifferentTypeAndValue(): void |
||
104 | |||
105 | /** |
||
106 | * @test |
||
107 | * |
||
108 | * @expectedException \InvalidArgumentException |
||
109 | * @expectedExceptionMessage Value [anything] is not matching any valid value of class "TestEnum". Valid values are ['A', 'BEE', 1, 3, NULL, true]. |
||
110 | */ |
||
111 | public function exceptionMessage(): void |
||
115 | |||
116 | /** |
||
117 | * @test |
||
118 | * |
||
119 | * @dataProvider getInvertedCaseOptions |
||
120 | * @expectedException \InvalidArgumentException |
||
121 | * |
||
122 | * @param mixed $option |
||
123 | */ |
||
124 | public function getWithInvertedCaseIsIncorrect($option): void |
||
128 | |||
129 | public function getInvertedCaseOptions() |
||
136 | |||
137 | /** |
||
138 | * @test |
||
139 | * |
||
140 | * @expectedException \InvalidArgumentException |
||
141 | */ |
||
142 | public function getWithStrictEqualMatchThrowsException(): void |
||
146 | |||
147 | |||
148 | /** |
||
149 | * @test |
||
150 | */ |
||
151 | public function isShouldAllowToCallMethodsBasedOnConstantNames(): void |
||
158 | |||
159 | /** |
||
160 | * @test |
||
161 | * |
||
162 | * @expectedException \BadMethodCallException |
||
163 | * @expectedExceptionMessage Werkspot\Enum\Tests\TestEnum::isDoesNotExist() does not exist |
||
164 | */ |
||
165 | public function isShouldThrowAnExceptionWhenWhenCallingAnInvalidMethod(): void |
||
166 | { |
||
167 | $enum = TestEnum::a(); |
||
168 | $enum->isDoesNotExist(); |
||
169 | } |
||
170 | |||
171 | /** |
||
172 | * @test |
||
173 | * |
||
174 | * @expectedException \BadMethodCallException |
||
175 | * @expectedExceptionMessage Werkspot\Enum\Tests\TestEnum::doesNotExist() does not exist |
||
176 | */ |
||
177 | public function shouldThrowAnExceptionWhenWhenCallingAnInvalidStaticMethod(): void |
||
178 | { |
||
179 | TestEnum::doesNotExist(); |
||
180 | } |
||
181 | |||
182 | /** |
||
183 | * @test |
||
184 | */ |
||
185 | public function getValidOptions(): void |
||
199 | } |
||
200 |