Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
DuplicateValueNestedDummy example
$foobar
->foo = 'foo';
$foobar
->bar = 'bar';
$classMetadataFactory
=
new
ClassMetadataFactory
(
new
AnnotationLoader
(
)
)
;
$normalizer
=
new
ObjectNormalizer
(
$classMetadataFactory
,
new
MetadataAwareNameConverter
(
$classMetadataFactory
)
)
;
$normalizer
->
normalize
(
$foobar
, 'any'
)
;
}
public
function
testNormalizeWithNestedAttributesElementAlreadySet
(
)
{
$this
->
expectException
(
LogicException::
class
)
;
$this
->
expectExceptionMessage
(
'The element you are trying to set is already populated: "[one][two][three]"'
)
;
$foobar
=
new
DuplicateValueNestedDummy
(
)
;
$foobar
->foo = 'foo';
$foobar
->bar = 'bar';
$classMetadataFactory
=
new
ClassMetadataFactory
(
new
AnnotationLoader
(
)
)
;
$normalizer
=
new
ObjectNormalizer
(
$classMetadataFactory
,
new
MetadataAwareNameConverter
(
$classMetadataFactory
)
)
;
$normalizer
->
normalize
(
$foobar
, 'any'
)
;
}
public
function
testNormalizeWithNestedAttributes
(
)
{
$foobar
=
new
NestedDummy
(
)
;
$foobar
->foo = 'foo';