$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';
$foobar->quux = 'quux';
$foobar->baz = 'baz';
$foobar->notfoo = 'notfoo';
$data =
[ 'one' =>
[ 'two' =>
[ 'three' => 'foo',
],
'four' => 'quux',
],