@@ -216,10 +216,6 @@ public function testLoadValuesForChoicesLoadsIfSingleIntIdAndValueGiven()
216
216
$ choices = [$ this ->obj1 , $ this ->obj2 , $ this ->obj3 ];
217
217
$ value = function (\stdClass $ object ) { return $ object ->name ; };
218
218
219
- $ this ->idReader ->expects ($ this ->any ())
220
- ->method ('isSingleId ' )
221
- ->willReturn (true );
222
-
223
219
$ this ->repository ->expects ($ this ->once ())
224
220
->method ('findAll ' )
225
221
->willReturn ($ choices );
@@ -240,10 +236,6 @@ public function testLoadValuesForChoicesDoesNotLoadIfValueIsIdReader()
240
236
241
237
$ value = [$ this ->idReader , 'getIdValue ' ];
242
238
243
- $ this ->idReader ->expects ($ this ->any ())
244
- ->method ('isSingleId ' )
245
- ->willReturn (true );
246
-
247
239
$ this ->repository ->expects ($ this ->never ())
248
240
->method ('findAll ' );
249
241
@@ -304,10 +296,6 @@ public function testLoadChoicesForValuesLoadsOnlyChoicesIfSingleIntId()
304
296
305
297
$ choices = [$ this ->obj2 , $ this ->obj3 ];
306
298
307
- $ this ->idReader ->expects ($ this ->any ())
308
- ->method ('isSingleId ' )
309
- ->willReturn (true );
310
-
311
299
$ this ->idReader ->expects ($ this ->any ())
312
300
->method ('getIdField ' )
313
301
->willReturn ('idField ' );
@@ -344,10 +332,6 @@ public function testLoadChoicesForValuesLoadsAllIfSingleIntIdAndValueGiven()
344
332
$ choices = [$ this ->obj1 , $ this ->obj2 , $ this ->obj3 ];
345
333
$ value = function (\stdClass $ object ) { return $ object ->name ; };
346
334
347
- $ this ->idReader ->expects ($ this ->any ())
348
- ->method ('isSingleId ' )
349
- ->willReturn (true );
350
-
351
335
$ this ->repository ->expects ($ this ->once ())
352
336
->method ('findAll ' )
353
337
->willReturn ($ choices );
@@ -370,10 +354,6 @@ public function testLoadChoicesForValuesLoadsOnlyChoicesIfValueIsIdReader()
370
354
$ choices = [$ this ->obj2 , $ this ->obj3 ];
371
355
$ value = [$ this ->idReader , 'getIdValue ' ];
372
356
373
- $ this ->idReader ->expects ($ this ->any ())
374
- ->method ('isSingleId ' )
375
- ->willReturn (true );
376
-
377
357
$ this ->idReader ->expects ($ this ->any ())
378
358
->method ('getIdField ' )
379
359
->willReturn ('idField ' );
@@ -446,14 +426,6 @@ public function testLoaderWithoutIdReaderCanBeOptimized()
446
426
447
427
$ choices = [$ obj1 , $ obj2 ];
448
428
449
- $ this ->idReader ->expects ($ this ->any ())
450
- ->method ('isSingleId ' )
451
- ->willReturn (true );
452
-
453
- $ this ->idReader ->expects ($ this ->any ())
454
- ->method ('getIdField ' )
455
- ->willReturn ('idField ' );
456
-
457
429
$ this ->repository ->expects ($ this ->never ())
458
430
->method ('findAll ' );
459
431
@@ -462,13 +434,6 @@ public function testLoaderWithoutIdReaderCanBeOptimized()
462
434
->with ('idField ' , ['1 ' ])
463
435
->willReturn ($ choices );
464
436
465
- $ this ->idReader ->expects ($ this ->any ())
466
- ->method ('getIdValue ' )
467
- ->willReturnMap ([
468
- [$ obj1 , '1 ' ],
469
- [$ obj2 , '2 ' ],
470
- ]);
471
-
472
437
$ this ->assertSame ([$ obj1 ], $ loader ->loadChoicesForValues (['1 ' ]));
473
438
}
474
439
0 commit comments