'title' => 'This value should be of type int.',
'template' => 'This value should be of type {{ type }}.',
'parameters' =>
[ '{{ type }}' => 'int',
],
'hint' => 'Invalid value',
],
],
];
$exception = NotNormalizableValueException::
createForUnexpectedDataType('Invalid value', null,
['int'
], 'foo', true
);
$exception =
new PartialDenormalizationException('Validation Failed',
[$exception]);
$exception =
new HttpException(422, 'Validation Failed',
$exception);
$this->
assertSame($expected,
$this->normalizer->
normalize(FlattenException::
createFromThrowable($exception), null,
['exception' =>
$exception]));
} public function testNormalizeValidationFailedException() { $this->normalizer->
setSerializer(new Serializer([new ConstraintViolationListNormalizer()]));
$expected =
[ 'type' => 'https://symfony.com/errors/validation',
'title' => 'Validation Failed',