'type' => 'urn:uuid:6',
'parameters' =>
[],
],
],
];
$this->
assertEquals($expected,
$this->normalizer->
normalize($list));
} public function testNormalizeWithNameConverter() { $normalizer =
new ConstraintViolationListNormalizer([],
new CamelCaseToSnakeCaseNameConverter());
$list =
new ConstraintViolationList([ new ConstraintViolation('too short', 'a',
[], '3', 'shortDescription', ''
),
new ConstraintViolation('too long', 'b',
[], '3', 'product.shortDescription', 'Lorem ipsum dolor sit amet'
),
new ConstraintViolation('error', 'c',
[], '3', '', ''
),
]);
$expected =
[ 'type' => 'https://symfony.com/errors/validation',
'title' => 'Validation Failed',
'detail' => 'short_description: too short
product.short_description: too long
error',