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