| @@ 161-172 (lines=12) @@ | ||
| 158 | } |
|
| 159 | } |
|
| 160 | ||
| 161 | public function testGetValues() |
|
| 162 | { |
|
| 163 | $expectedValues = array_values(EnumInheritance::getConstants()); |
|
| 164 | $values = EnumInheritance::getValues(); |
|
| 165 | $count = count($values); |
|
| 166 | ||
| 167 | $this->assertSame(count($expectedValues), $count); |
|
| 168 | for ($i = 0; $i < $count; ++$i) { |
|
| 169 | $this->assertArrayHasKey($i, $values); |
|
| 170 | $this->assertSame($expectedValues[$i], $values[$i]); |
|
| 171 | } |
|
| 172 | } |
|
| 173 | ||
| 174 | public function testGetNamesConstantsAlreadyDetected() |
|
| 175 | { |
|
| @@ 174-185 (lines=12) @@ | ||
| 171 | } |
|
| 172 | } |
|
| 173 | ||
| 174 | public function testGetNamesConstantsAlreadyDetected() |
|
| 175 | { |
|
| 176 | $expectedNames = array_keys(EnumInheritance::getConstants()); |
|
| 177 | $names = EnumInheritance::getNames(); |
|
| 178 | $count = count($names); |
|
| 179 | ||
| 180 | $this->assertSame(count($expectedNames), $count); |
|
| 181 | for ($i = 0; $i < $count; ++$i) { |
|
| 182 | $this->assertArrayHasKey($i, $names); |
|
| 183 | $this->assertSame($expectedNames[$i], $names[$i]); |
|
| 184 | } |
|
| 185 | } |
|
| 186 | ||
| 187 | public function testGetNamesConstantsNotDetected() |
|
| 188 | { |
|
| @@ 187-198 (lines=12) @@ | ||
| 184 | } |
|
| 185 | } |
|
| 186 | ||
| 187 | public function testGetNamesConstantsNotDetected() |
|
| 188 | { |
|
| 189 | $names = EnumInheritance::getNames(); |
|
| 190 | $expectedNames = array_keys(EnumInheritance::getConstants()); |
|
| 191 | $count = count($names); |
|
| 192 | ||
| 193 | $this->assertSame(count($expectedNames), $count); |
|
| 194 | for ($i = 0; $i < $count; ++$i) { |
|
| 195 | $this->assertArrayHasKey($i, $names); |
|
| 196 | $this->assertSame($expectedNames[$i], $names[$i]); |
|
| 197 | } |
|
| 198 | } |
|
| 199 | ||
| 200 | public function testGetOrdinals() |
|
| 201 | { |
|
| @@ 200-211 (lines=12) @@ | ||
| 197 | } |
|
| 198 | } |
|
| 199 | ||
| 200 | public function testGetOrdinals() |
|
| 201 | { |
|
| 202 | $constants = EnumInheritance::getConstants(); |
|
| 203 | $ordinals = EnumInheritance::getOrdinals(); |
|
| 204 | $count = count($ordinals); |
|
| 205 | ||
| 206 | $this->assertSame(count($constants), $count); |
|
| 207 | for ($i = 0; $i < $count; ++$i) { |
|
| 208 | $this->assertArrayHasKey($i, $ordinals); |
|
| 209 | $this->assertSame($i, $ordinals[$i]); |
|
| 210 | } |
|
| 211 | } |
|
| 212 | ||
| 213 | public function testGetAllValues() |
|
| 214 | { |
|