@@ -216,10 +216,6 @@ public function testLoadValuesForChoicesLoadsIfSingleIntIdAndValueGiven()
216216 $ choices = [$ this ->obj1 , $ this ->obj2 , $ this ->obj3 ];
217217 $ value = function (\stdClass $ object ) { return $ object ->name ; };
218218
219- $ this ->idReader ->expects ($ this ->any ())
220- ->method ('isSingleId ' )
221- ->willReturn (true );
222-
223219 $ this ->repository ->expects ($ this ->once ())
224220 ->method ('findAll ' )
225221 ->willReturn ($ choices );
@@ -240,10 +236,6 @@ public function testLoadValuesForChoicesDoesNotLoadIfValueIsIdReader()
240236
241237 $ value = [$ this ->idReader , 'getIdValue ' ];
242238
243- $ this ->idReader ->expects ($ this ->any ())
244- ->method ('isSingleId ' )
245- ->willReturn (true );
246-
247239 $ this ->repository ->expects ($ this ->never ())
248240 ->method ('findAll ' );
249241
@@ -304,10 +296,6 @@ public function testLoadChoicesForValuesLoadsOnlyChoicesIfSingleIntId()
304296
305297 $ choices = [$ this ->obj2 , $ this ->obj3 ];
306298
307- $ this ->idReader ->expects ($ this ->any ())
308- ->method ('isSingleId ' )
309- ->willReturn (true );
310-
311299 $ this ->idReader ->expects ($ this ->any ())
312300 ->method ('getIdField ' )
313301 ->willReturn ('idField ' );
@@ -344,10 +332,6 @@ public function testLoadChoicesForValuesLoadsAllIfSingleIntIdAndValueGiven()
344332 $ choices = [$ this ->obj1 , $ this ->obj2 , $ this ->obj3 ];
345333 $ value = function (\stdClass $ object ) { return $ object ->name ; };
346334
347- $ this ->idReader ->expects ($ this ->any ())
348- ->method ('isSingleId ' )
349- ->willReturn (true );
350-
351335 $ this ->repository ->expects ($ this ->once ())
352336 ->method ('findAll ' )
353337 ->willReturn ($ choices );
@@ -370,10 +354,6 @@ public function testLoadChoicesForValuesLoadsOnlyChoicesIfValueIsIdReader()
370354 $ choices = [$ this ->obj2 , $ this ->obj3 ];
371355 $ value = [$ this ->idReader , 'getIdValue ' ];
372356
373- $ this ->idReader ->expects ($ this ->any ())
374- ->method ('isSingleId ' )
375- ->willReturn (true );
376-
377357 $ this ->idReader ->expects ($ this ->any ())
378
6D40
358 ->method ('getIdField ' )
379359 ->willReturn ('idField ' );
@@ -446,14 +426,6 @@ public function testLoaderWithoutIdReaderCanBeOptimized()
446426
447427 $ choices = [$ obj1 , $ obj2 ];
448428
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-
457429 $ this ->repository ->expects ($ this ->never ())
458430 ->method ('findAll ' );
459431
@@ -462,13 +434,6 @@ public function testLoaderWithoutIdReaderCanBeOptimized()
462434 ->with ('idField ' , ['1 ' ])
463435 ->willReturn ($ choices );
464436
465- $ this ->idReader ->expects ($ this ->any ())
466- ->method ('getIdValue ' )
467- ->willReturnMap ([
468- [$ obj1 , '1 ' ],
469- [$ obj2 , '2 ' ],
470- ]);
471-
472437 $ this ->assertSame ([$ obj1 ], $ loader ->loadChoicesForValues (['1 ' ]));
473438 }
474439
0 commit comments