Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
myName example
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
(
)
)
;
}
public
function
testMapFormsToDataUsingSetCallbackOption
(
)
{
$person
=
new
DummyPerson
(
'John Doe'
)
;