$this->
assertSame( ['value 2' =>
$object2],
$this->factory->
createListFromChoices($choices,
new PropertyPath('property'
),
new PropertyPath('filter'
))->
getChoices() );
} public function testCreateFromLoaderPropertyPath() { $object =
(object) ['property' => 'value'
];
$loader =
new ArrayChoiceLoader([$object]);
$this->
assertSame(['value' =>
$object],
$this->factory->
createListFromLoader($loader, 'property'
)->
getChoices());
} public function testCreateFromLoaderFilterPropertyPath() { $object1 =
(object) ['property' => 'value 1', 'filter' => false
];
$object2 =
(object) ['property' => 'value 2', 'filter' => true
];
$choices =
[ 'one' =>
$object1,
'two' =>
$object2,
];
$loader =
new ArrayChoiceLoader($choices);