EOF;
$extractor =
new PhpDocExtractor();
$propertyNormalizer =
new PropertyNormalizer(null, null,
$extractor);
$serializer =
new Serializer([ new ArrayDenormalizer(),
new MimeMessageNormalizer($propertyNormalizer),
new ObjectNormalizer(null, null, null,
$extractor),
$propertyNormalizer,
],
[new JsonEncoder()]);
$serialized =
$serializer->
serialize($e, 'json',
[ObjectNormalizer::IGNORED_ATTRIBUTES =>
['cachedBody'
]]);
$this->
assertSame($expectedJson,
json_encode(json_decode($serialized), \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES
));
$n =
$serializer->
deserialize($serialized, Email::
class, 'json'
);
$serialized =
$serializer->
serialize($e, 'json',
[ObjectNormalizer::IGNORED_ATTRIBUTES =>
['cachedBody'
]]);
$this->
assertSame($expectedJson,
json_encode(json_decode($serialized), \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES
));