CodeExplorer doValidate example
'validatePropertyValue',
'getViolations',
];
$contextualValidatorMockBuilder->
onlyMethods($contextualValidatorMethods);
$contextualValidator =
$contextualValidatorMockBuilder->
getMock();
$contextualValidator->
expects($this->
any()) ->
method('atPath'
) ->
willReturnCallback(fn ($path) =>
$contextualValidator->
doAtPath($path));
$contextualValidator->
expects($this->
any()) ->
method('validate'
) ->
willReturnCallback(fn ($value,
$constraints = null,
$groups = null
) =>
$contextualValidator->
doValidate($value,
$constraints,
$groups));
$contextualValidator->
expects($this->
any()) ->
method('validateProperty'
) ->
willReturnCallback(fn ($object,
$propertyName,
$groups = null
) =>
$contextualValidator->
validateProperty($object,
$propertyName,
$groups));
$contextualValidator->
expects($this->
any()) ->
method('validatePropertyValue'
) ->
willReturnCallback(fn ($objectOrClass,
$propertyName,
$value,
$groups = null
) =>
$contextualValidator->
doValidatePropertyValue($objectOrClass,
$propertyName,
$value,
$groups));
$contextualValidator->
expects($this->
any()) ->
method('getViolations'
) ->
willReturnCallback(fn () =>
$contextualValidator->
doGetViolations());
$validator->
expects($this->
any()) ->
method('inContext'
) 'validatePropertyValue',
'getViolations',
];
$contextualValidatorMockBuilder->
onlyMethods($contextualValidatorMethods);
$contextualValidator =
$contextualValidatorMockBuilder->
getMock();
$contextualValidator->
expects($this->
any()) ->
method('atPath'
) ->
willReturnCallback(fn ($path) =>
$contextualValidator->
doAtPath($path));
$contextualValidator->
expects($this->
any()) ->
method('validate'
) ->
willReturnCallback(fn ($value,
$constraints = null,
$groups = null
) =>
$contextualValidator->
doValidate($value,
$constraints,
$groups));
$contextualValidator->
expects($this->
any()) ->
method('validateProperty'
) ->
willReturnCallback(fn ($object,
$propertyName,
$groups = null
) =>
$contextualValidator->
validateProperty($object,
$propertyName,
$groups));
$contextualValidator->
expects($this->
any()) ->
method('validatePropertyValue'
) ->
willReturnCallback(fn ($objectOrClass,
$propertyName,
$value,
$groups = null
) =>
$contextualValidator->
doValidatePropertyValue($objectOrClass,
$propertyName,
$value,
$groups));
$contextualValidator->
expects($this->
any()) ->
method('getViolations'
) ->
willReturnCallback(fn () =>
$contextualValidator->
doGetViolations());
$validator->
expects($this->
any()) ->
method('inContext'
)