use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader;
use Symfony\Component\Serializer\Normalizer\ArrayDenormalizer;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
use Symfony\Component\Serializer\Serializer;
class MapDenormalizationTest extends TestCase
{ public function testMapOfStringToNullableObject() { $normalizedData =
$this->
getSerializer()->
denormalize([ 'map' =>
[ 'assertDummyMapValue' =>
[ 'value' => 'foo',
],
'assertNull' => null,
],
], DummyMapOfStringToNullableObject::
class);
$this->
assertInstanceOf(DummyMapOfStringToNullableObject::
class,
$normalizedData);
// check nullable map value