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