return $this->obj1 ===
$object ||
$this->obj2 ===
$object ? 'Group 1' : 'Group 2';
} public function getGroupArray($object) { return $this->obj1 ===
$object ||
$this->obj2 ===
$object ?
['Group 1', 'Group 2'
] :
['Group 3'
];
} public function getGroupAsObject($object) { return $this->obj1 ===
$object ||
$this->obj2 ===
$object ?
new DefaultChoiceListFactoryTest_Castable('Group 1'
) :
new DefaultChoiceListFactoryTest_Castable('Group 2'
);
} protected function setUp(): void
{ $this->obj1 =
(object) ['label' => 'A', 'index' => 'w', 'value' => 'a', 'preferred' => false, 'group' => 'Group 1', 'attr' =>
[], 'labelTranslationParameters' =>
[]];
$this->obj2 =
(object) ['label' => 'B', 'index' => 'x', 'value' => 'b', 'preferred' => true, 'group' => 'Group 1', 'attr' =>
['attr1' => 'value1'
], 'labelTranslationParameters' =>
[]];
$this->obj3 =
(object) ['label' => 'C', 'index' => 'y', 'value' => 1, 'preferred' => true, 'group' => 'Group 2', 'attr' =>
['attr2' => 'value2'
], 'labelTranslationParameters' =>
[]];
$this->obj4 =
(object) ['label' => 'D', 'index' => 'z', 'value' => 2, 'preferred' => false, 'group' => 'Group 2', 'attr' =>
[], 'labelTranslationParameters' =>
['%placeholder1%' => 'value1'
]];
$this->list =
new ArrayChoiceList(['A' =>
$this->obj1, 'B' =>
$this->obj2, 'C' =>
$this->obj3, 'D' =>
$this->obj4
]);
$this->factory =
new DefaultChoiceListFactory();
}