Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
DeepObjectPopulateParentDummy example
$this
->
assertNotSame
(
$objectToPopulate
,
$inner
)
;
$this
->
assertSame
(
'bar',
$inner
->bar
)
;
$this
->
assertNull
(
$inner
->foo
)
;
}
public
function
testDeepObjectToPopulate
(
)
{
$child
=
new
DeepObjectPopulateChildDummy
(
)
;
$child
->bar = 'bar-old';
$child
->foo = 'foo-old';
$parent
=
new
DeepObjectPopulateParentDummy
(
)
;
$parent
->
setChild
(
$child
)
;
$context
=
[
'object_to_populate' =>
$parent
,
'deep_object_to_populate' => true,
]
;
$normalizer
=
$this
->
getDenormalizerForObjectToPopulate
(
)
;
$newChild
=
new
DeepObjectPopulateChildDummy
(
)
;
$newChild
->bar = 'bar-new';