| @@ 124-135 (lines=12) @@ | ||
| 121 | } |
|
| 122 | } |
|
| 123 | ||
| 124 | public function testGetValues() |
|
| 125 | { |
|
| 126 | $expectedValues = array_values(EnumInheritance::getConstants()); |
|
| 127 | $values = EnumInheritance::getValues(); |
|
| 128 | $count = count($values); |
|
| 129 | ||
| 130 | $this->assertSame(count($expectedValues), $count); |
|
| 131 | for ($i = 0; $i < $count; ++$i) { |
|
| 132 | $this->assertArrayHasKey($i, $values); |
|
| 133 | $this->assertSame($expectedValues[ $i ], $values[ $i ]); |
|
| 134 | } |
|
| 135 | } |
|
| 136 | ||
| 137 | public function testGetNames() |
|
| 138 | { |
|
| @@ 137-148 (lines=12) @@ | ||
| 134 | } |
|
| 135 | } |
|
| 136 | ||
| 137 | public function testGetNames() |
|
| 138 | { |
|
| 139 | $expectedNames = array_keys(EnumInheritance::getConstants()); |
|
| 140 | $names = EnumInheritance::getNames(); |
|
| 141 | $count = count($names); |
|
| 142 | ||
| 143 | $this->assertSame(count($expectedNames), $count); |
|
| 144 | for ($i = 0; $i < $count; ++$i) { |
|
| 145 | $this->assertArrayHasKey($i, $names); |
|
| 146 | $this->assertSame($expectedNames[ $i ], $names[ $i ]); |
|
| 147 | } |
|
| 148 | } |
|
| 149 | ||
| 150 | public function testGetOrdinals() |
|
| 151 | { |
|
| @@ 150-161 (lines=12) @@ | ||
| 147 | } |
|
| 148 | } |
|
| 149 | ||
| 150 | public function testGetOrdinals() |
|
| 151 | { |
|
| 152 | $constants = EnumInheritance::getConstants(); |
|
| 153 | $ordinals = EnumInheritance::getOrdinals(); |
|
| 154 | $count = count($ordinals); |
|
| 155 | ||
| 156 | $this->assertSame(count($constants), $count); |
|
| 157 | for ($i = 0; $i < $count; ++$i) { |
|
| 158 | $this->assertArrayHasKey($i, $ordinals); |
|
| 159 | $this->assertSame($i, $ordinals[ $i ]); |
|
| 160 | } |
|
| 161 | } |
|
| 162 | ||
| 163 | public function testGetAllValues() |
|
| 164 | { |
|