/**
* @dataProvider provideValidationGroupsOnManyTypes
*/
public function testValidationGroupsPassed(string
$method, ValueResolver
$attribute) { $input =
['price' => '50', 'title' => 'A long title, so the validation passes'
];
$payload =
new RequestPayload(50
);
$payload->title = 'A long title, so the validation passes';
$serializer =
new Serializer([new ObjectNormalizer()]);
$validator =
(new ValidatorBuilder())->
enableAttributeMapping()->
getValidator();
$resolver =
new RequestPayloadValueResolver($serializer,
$validator);
$request = Request::
create('/',
$method,
$input);
$argument =
new ArgumentMetadata('valid', RequestPayload::
class, false, false, null, false,
[ $attribute::
class => $attribute,
]);
$kernel =
$this->
createMock(HttpKernelInterface::
class);
$arguments =
$resolver->
resolve($request,
$argument);
$event =
new ControllerArgumentsEvent($kernel,
function D
) {},
$arguments,
$request, HttpKernelInterface::MAIN_REQUEST
);