2727
2828class DefaultChoiceListFactoryTest extends TestCase
2929{
30- private $ obj1 ;
31-
32- private $ obj2 ;
33-
34- private $ obj3 ;
35-
36- private $ obj4 ;
37-
38- private $ obj5 ;
39-
40- private $ obj6 ;
41-
42- private $ list ;
43-
44- /**
45- * @var DefaultChoiceListFactory
46- */
47- private $ factory ;
30+ private \stdClass $ obj1 ;
31+ private \stdClass $ obj2 ;
32+ private \stdClass $ obj3 ;
33+ private \stdClass $ obj4 ;
34+ private ArrayChoiceList $ list ;
35+ private DefaultChoiceListFactory $ factory ;
4836
4937 public function getValue ($ object )
5038 {
@@ -208,9 +196,9 @@ public function testCreateFromChoicesGroupedValuesAsClosure()
208196 public function testCreateFromFilteredChoices ()
209197 {
210198 $ list = $ this ->factory ->createListFromChoices (
211- ['A ' => $ this ->obj1 , 'B ' => $ this ->obj2 , 'C ' => $ this ->obj3 , 'D ' => $ this ->obj4 , 'E ' => $ this -> obj5 , 'F ' => $ this -> obj6 ],
199+ ['A ' => $ this ->obj1 , 'B ' => $ this ->obj2 , 'C ' => $ this ->obj3 , 'D ' => $ this ->obj4 , 'E ' => null , 'F ' => null ],
212200 null ,
213- fn ($ choice ) => $ choice !== $ this -> obj5 && $ choice !== $ this -> obj6
201+ fn ($ choice ) => null !== $ choice
214202 );
215203
216204 $ this ->assertObjectListWithGeneratedValues ($ list );
@@ -222,11 +210,11 @@ public function testCreateFromChoicesGroupedAndFiltered()
222210 [
223211 'Group 1 ' => ['A ' => $ this ->obj1 , 'B ' => $ this ->obj2 ],
224212 'Group 2 ' => ['C ' => $ this ->obj3 , 'D ' => $ this ->obj4 ],
225- 'Group 3 ' => ['E ' => $ this -> obj5 , 'F ' => $ this -> obj6 ],
213+ 'Group 3 ' => ['E ' => null , 'F ' => null ],
226214 'Group 4 ' => [/* empty group should be filtered */ ],
227215 ],
228216 null ,
229- fn ($ choice ) => $ choice !== $ this -> obj5 && $ choice !== $ this -> obj6
217+ fn ($ choice ) => null !== $ choice
230218 );
231219
232220 $ this ->assertObjectListWithGeneratedValues ($ list );
@@ -238,11 +226,11 @@ public function testCreateFromChoicesGroupedAndFilteredTraversable()
238226 new \ArrayIterator ([
239227 'Group 1 ' => ['A ' => $ this ->obj1 , 'B ' => $ this ->obj2 ],
240228 'Group 2 ' => ['C ' => $ this ->obj3 , 'D ' => $ this ->obj4 ],
241- 'Group 3 ' => ['E ' => $ this -> obj5 , 'F ' => $ this -> obj6 ],
229+ 'Group 3 ' => ['E ' => null , 'F ' => null ],
242230 'Group 4 ' => [/* empty group should be filtered */ ],
243231 ]),
244232 null ,
245- fn ($ choice ) => $ choice !== $ this -> obj5 && $ choice !== $ this -> obj6
233+ fn ($ choice ) => null !== $ choice
246234 );
247235
248236 $ this ->assertObjectListWithGeneratedValues ($ list );
@@ -1026,7 +1014,7 @@ private function assertGroupedViewWithChoiceDuplication($view)
10261014
10271015class DefaultChoiceListFactoryTest_Castable
10281016{
1029- private $ property ;
1017+ private string $ property ;
10301018
10311019 public function __construct ($ property )
10321020 {
0 commit comments