|
13 | 13 |
|
14 | 14 | /**
|
15 | 15 | * @author Bernhard Schussek <[email protected]>
|
| 16 | + * |
| 17 | + * @group legacy |
16 | 18 | */
|
17 | 19 | abstract class AbstractChoiceListTest extends \PHPUnit_Framework_TestCase
|
18 | 20 | {
|
@@ -123,8 +125,6 @@ abstract class AbstractChoiceListTest extends \PHPUnit_Framework_TestCase
|
123 | 125 |
|
124 | 126 | protected function setUp()
|
125 | 127 | {
|
126 |
| - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); |
127 |
| - |
128 | 128 | parent::setUp();
|
129 | 129 |
|
130 | 130 | $this->list = $this->createChoiceList();
|
@@ -153,151 +153,131 @@ protected function setUp()
|
153 | 153 | }
|
154 | 154 | }
|
155 | 155 |
|
156 |
| - public function testLegacyGetChoices() |
| 156 | + public function testGetChoices() |
157 | 157 | {
|
158 | 158 | $this->assertSame($this->choices, $this->list->getChoices());
|
159 | 159 | }
|
160 | 160 |
|
161 |
| - public function testLegacyGetValues() |
| 161 | + public function testGetValues() |
162 | 162 | {
|
163 | 163 | $this->assertSame($this->values, $this->list->getValues());
|
164 | 164 | }
|
165 | 165 |
|
166 |
| - public function testLegacyGetIndicesForChoices() |
| 166 | + public function testGetIndicesForChoices() |
167 | 167 | {
|
168 |
| - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); |
169 |
| - |
170 | 168 | $choices = array($this->choice1, $this->choice2);
|
171 | 169 | $this->assertSame(array($this->index1, $this->index2), $this->list->getIndicesForChoices($choices));
|
172 | 170 | }
|
173 | 171 |
|
174 |
| - public function testLegacyGetIndicesForChoicesPreservesKeys() |
| 172 | + public function testGetIndicesForChoicesPreservesKeys() |
175 | 173 | {
|
176 |
| - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); |
177 |
| - |
178 | 174 | $choices = array(5 => $this->choice1, 8 => $this->choice2);
|
179 | 175 | $this->assertSame(array(5 => $this->index1, 8 => $this->index2), $this->list->getIndicesForChoices($choices));
|
180 | 176 | }
|
181 | 177 |
|
182 |
| - public function testLegacyGetIndicesForChoicesPreservesOrder() |
| 178 | + public function testGetIndicesForChoicesPreservesOrder() |
183 | 179 | {
|
184 |
| - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); |
185 |
| - |
186 | 180 | $choices = array($this->choice2, $this->choice1);
|
187 | 181 | $this->assertSame(array($this->index2, $this->index1), $this->list->getIndicesForChoices($choices));
|
188 | 182 | }
|
189 | 183 |
|
190 |
| - public function testLegacyGetIndicesForChoicesIgnoresNonExistingChoices() |
| 184 | + public function testGetIndicesForChoicesIgnoresNonExistingChoices() |
191 | 185 | {
|
192 |
| - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); |
193 |
| - |
194 | 186 | $choices = array($this->choice1, $this->choice2, 'foobar');
|
195 | 187 | $this->assertSame(array($this->index1, $this->index2), $this->list->getIndicesForChoices($choices));
|
196 | 188 | }
|
197 | 189 |
|
198 |
| - public function testLegacyGetIndicesForChoicesEmpty() |
| 190 | + public function testGetIndicesForChoicesEmpty() |
199 | 191 | {
|
200 |
| - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); |
201 |
| - |
202 | 192 | $this->assertSame(array(), $this->list->getIndicesForChoices(array()));
|
203 | 193 | }
|
204 | 194 |
|
205 |
| - public function testLegacyGetIndicesForValues() |
| 195 | + public function testGetIndicesForValues() |
206 | 196 | {
|
207 |
| - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); |
208 |
| - |
209 | 197 | // values and indices are always the same
|
210 | 198 | $values = array($this->value1, $this->value2);
|
211 | 199 | $this->assertSame(array($this->index1, $this->index2), $this->list->getIndicesForValues($values));
|
212 | 200 | }
|
213 | 201 |
|
214 |
| - public function testLegacyGetIndicesForValuesPreservesKeys() |
| 202 | + public function testGetIndicesForValuesPreservesKeys() |
215 | 203 | {
|
216 |
| - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); |
217 |
| - |
218 | 204 | // values and indices are always the same
|
219 | 205 | $values = array(5 => $this->value1, 8 => $this->value2);
|
220 | 206 | $this->assertSame(array(5 => $this->index1, 8 => $this->index2), $this->list->getIndicesForValues($values));
|
221 | 207 | }
|
222 | 208 |
|
223 |
| - public function testLegacyGetIndicesForValuesPreservesOrder() |
| 209 | + public function testGetIndicesForValuesPreservesOrder() |
224 | 210 | {
|
225 |
| - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); |
226 |
| - |
227 | 211 | $values = array($this->value2, $this->value1);
|
228 | 212 | $this->assertSame(array($this->index2, $this->index1), $this->list->getIndicesForValues($values));
|
229 | 213 | }
|
230 | 214 |
|
231 |
| - public function testLegacyGetIndicesForValuesIgnoresNonExistingValues() |
| 215 | + public function testGetIndicesForValuesIgnoresNonExistingValues() |
232 | 216 | {
|
233 |
| - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); |
234 |
| - |
235 | 217 | $values = array($this->value1, $this->value2, 'foobar');
|
236 | 218 | $this->assertSame(array($this->index1, $this->index2), $this->list->getIndicesForValues($values));
|
237 | 219 | }
|
238 | 220 |
|
239 |
| - public function testLegacyGetIndicesForValuesEmpty() |
| 221 | + public function testGetIndicesForValuesEmpty() |
240 | 222 | {
|
241 |
| - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); |
242 |
| - |
243 | 223 | $this->assertSame(array(), $this->list->getIndicesForValues(array()));
|
244 | 224 | }
|
245 | 225 |
|
246 |
| - public function testLegacyGetChoicesForValues() |
| 226 | + public function testGetChoicesForValues() |
247 | 227 | {
|
248 | 228 | $values = array($this->value1, $this->value2);
|
249 | 229 | $this->assertSame(array($this->choice1, $this->choice2), $this->list->getChoicesForValues($values));
|
250 | 230 | }
|
251 | 231 |
|
252 |
| - public function testLegacyGetChoicesForValuesPreservesKeys() |
| 232 | + public function testGetChoicesForValuesPreservesKeys() |
253 | 233 | {
|
254 | 234 | $values = array(5 => $this->value1, 8 => $this->value2);
|
255 | 235 | $this->assertSame(array(5 => $this->choice1, 8 => $this->choice2), $this->list->getChoicesForValues($values));
|
256 | 236 | }
|
257 | 237 |
|
258 |
| - public function testLegacyGetChoicesForValuesPreservesOrder() |
| 238 | + public function testGetChoicesForValuesPreservesOrder() |
259 | 239 | {
|
260 | 240 | $values = array($this->value2, $this->value1);
|
261 | 241 | $this->assertSame(array($this->choice2, $this->choice1), $this->list->getChoicesForValues($values));
|
262 | 242 | }
|
263 | 243 |
|
264 |
| - public function testLegacyGetChoicesForValuesIgnoresNonExistingValues() |
| 244 | + public function testGetChoicesForValuesIgnoresNonExistingValues() |
265 | 245 | {
|
266 | 246 | $values = array($this->value1, $this->value2, 'foobar');
|
267 | 247 | $this->assertSame(array($this->choice1, $this->choice2), $this->list->getChoicesForValues($values));
|
268 | 248 | }
|
269 | 249 |
|
270 | 250 | // https://github.com/symfony/symfony/issues/3446
|
271 |
| - public function testLegacyGetChoicesForValuesEmpty() |
| 251 | + public function testGetChoicesForValuesEmpty() |
272 | 252 | {
|
273 | 253 | $this->assertSame(array(), $this->list->getChoicesForValues(array()));
|
274 | 254 | }
|
275 | 255 |
|
276 |
| - public function testLegacyGetValuesForChoices() |
| 256 | + public function testGetValuesForChoices() |
277 | 257 | {
|
278 | 258 | $choices = array($this->choice1, $this->choice2);
|
279 | 259 | $this->assertSame(array($this->value1, $this->value2), $this->list->getValuesForChoices($choices));
|
280 | 260 | }
|
281 | 261 |
|
282 |
| - public function testLegacyGetValuesForChoicesPreservesKeys() |
| 262 | + public function testGetValuesForChoicesPreservesKeys() |
283 | 263 | {
|
284 | 264 | $choices = array(5 => $this->choice1, 8 => $this->choice2);
|
285 | 265 | $this->assertSame(array(5 => $this->value1, 8 => $this->value2), $this->list->getValuesForChoices($choices));
|
286 | 266 | }
|
287 | 267 |
|
288 |
| - public function testLegacyGetValuesForChoicesPreservesOrder() |
| 268 | + public function testGetValuesForChoicesPreservesOrder() |
289 | 269 | {
|
290 | 270 | $choices = array($this->choice2, $this->choice1);
|
291 | 271 | $this->assertSame(array($this->value2, $this->value1), $this->list->getValuesForChoices($choices));
|
292 | 272 | }
|
293 | 273 |
|
294 |
| - public function testLegacyGetValuesForChoicesIgnoresNonExistingChoices() |
| 274 | + public function testGetValuesForChoicesIgnoresNonExistingChoices() |
295 | 275 | {
|
296 | 276 | $choices = array($this->choice1, $this->choice2, 'foobar');
|
297 | 277 | $this->assertSame(array($this->value1, $this->value2), $this->list->getValuesForChoices($choices));
|
298 | 278 | }
|
299 | 279 |
|
300 |
| - public function testLegacyGetValuesForChoicesEmpty() |
| 280 | + public function testGetValuesForChoicesEmpty() |
301 | 281 | {
|
302 | 282 | $this->assertSame(array(), $this->list->getValuesForChoices(array()));
|
303 | 283 | }
|
|
0 commit comments