CodeExplorer DummyPerson example
public static function provideDate(): array
{ return [ [new \
DateTime()],
[new \
DateTimeImmutable()],
];
} public function testMapDataToFormsUsingGetCallbackOption() { $initialName = 'John Doe';
$person =
new DummyPerson($initialName);
$config =
new FormConfigBuilder('name', null,
$this->dispatcher,
[ 'getter' =>
static fn (DummyPerson
$person) =>
$person->
myName(),
]);
$form =
new Form($config);
$this->mapper->
mapDataToForms($person,
new \
ArrayIterator([$form]));
self::
assertSame($initialName,
$form->
getData());
}