@@ -152,9 +152,6 @@ public function testLoadValuesForChoicesDoesNotLoadIfEmptyChoices()
152
152
153
153
public function testLoadValuesForChoicesDoesNotLoadIfSingleIntId ()
154
154
{
155
- $ this ->expectException (LogicException::class);
156
- $ this ->expectExceptionMessage ('Not defining the IdReader explicitly as a value callback when the query can be optimized is not supported. ' );
157
-
158
155
$ loader = new DoctrineChoiceLoader (
159
156
$ this ->om ,
160
157
$ this ->class ,
@@ -169,7 +166,10 @@ public function testLoadValuesForChoicesDoesNotLoadIfSingleIntId()
169
166
->with ($ this ->obj2 )
170
167
->willReturn ('2 ' );
171
168
172
- $ this ->assertSame (['2 ' ], $ loader ->loadValuesForChoices ([$ this ->obj2 ]));
169
+ $ this ->expectException (LogicException::class);
170
+ $ this ->expectExceptionMessage ('Not defining the IdReader explicitly as a value callback when the query can be optimized is not supported. ' );
171
+
172
+ $ loader ->loadValuesForChoices ([$ this ->obj2 ]);
173
173
}
174
174
175
175
public function testLoadValuesForChoicesDoesNotLoadIfSingleIntIdAndValueGiven ()
@@ -253,18 +253,13 @@ public function testLoadChoicesForValuesDoesNotLoadIfEmptyValues()
253
253
254
254
public function testLegacyLoadChoicesForValuesLoadsOnlyChoicesIfValueUseIdReader ()
255
255
{
256
- $ this ->expectException (LogicException::class);
257
- $ this ->expectExceptionMessage ('Not defining the IdReader explicitly as a value callback when the query can be optimized is not supported. ' );
258
-
259
256
$ loader = new DoctrineChoiceLoader (
260
257
$ this ->om ,
261
258
$ this ->class ,
262
259
$ this ->idReader ,
263
260
$ this ->objectLoader
264
261
);
265
262
266
- $ choices = [$ this ->obj2 , $ this ->obj3 ];
267
-
268
263
$ this ->idReader ->expects ($ this ->any ())
269
264
->method ('getIdField ' )
270
265
->willReturn ('idField ' );
@@ -275,10 +270,10 @@ public function testLegacyLoadChoicesForValuesLoadsOnlyChoicesIfValueUseIdReader
275
270
$ this ->objectLoader ->expects ($ this ->never ())
276
271
->method ('getEntitiesByIds ' );
277
272
278
- $ this ->assertSame (
279
- [ 4 => $ this -> obj3 , 7 => $ this -> obj2 ],
280
- $ loader -> loadChoicesForValues ([ 4 => ' 3 ' , 7 => ' 2 ' ])
281
- );
273
+ $ this ->expectException (LogicException::class);
274
+ $ this -> expectExceptionMessage ( ' Not defining the IdReader explicitly as a value callback when the query can be optimized is not supported. ' );
275
+
276
+ $ loader -> loadChoicesForValues ([ 4 => ' 3 ' , 7 => ' 2 ' ] );
282
277
}
283
278
284
279
public function testLoadChoicesForValuesLoadsOnlyChoicesIfValueUseIdReader ()
0 commit comments