];
$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',
'status' => 422,
'detail' => 'Invalid value',
'violations' =>
[ [ 'propertyPath' => '',
'title' => 'Invalid value',
'template' => '',