W3cubDocs

/Symfony 4.1

ConstraintValidatorTestCase

abstract class ConstraintValidatorTestCase extends TestCase

A test case to ease testing Constraint Validators.

Properties

protected ExecutionContextInterface $context
protected ConstraintValidatorInterface $validator
protected $group
protected $metadata
protected $object
protected $value
protected $root
protected $propertyPath
protected $constraint
protected $defaultTimezone

Methods

setUp()
tearDown()
setDefaultTimezone($defaultTimezone)
restoreDefaultTimezone()
createContext()
setGroup($group)
setObject($object)
setProperty($object, $property)
setValue($value)
setRoot($root)
setPropertyPath($propertyPath)
expectNoValidate()
expectValidateAt($i, $propertyPath, $value, $group)
expectValidateValueAt($i, $propertyPath, $value, $constraints, $group = null)
assertNoViolation()
ConstraintViolationAssertion buildViolation($message)
createValidator()

Details

protected setUp()

protected tearDown()

protected setDefaultTimezone($defaultTimezone)

Parameters

$defaultTimezone

protected restoreDefaultTimezone()

protected createContext()

protected setGroup($group)

Parameters

$group

protected setObject($object)

Parameters

$object

protected setProperty($object, $property)

Parameters

$object
$property

protected setValue($value)

Parameters

$value

protected setRoot($root)

Parameters

$root

protected setPropertyPath($propertyPath)

Parameters

$propertyPath

protected expectNoValidate()

protected expectValidateAt($i, $propertyPath, $value, $group)

Parameters

$i
$propertyPath
$value
$group

protected expectValidateValueAt($i, $propertyPath, $value, $constraints, $group = null)

Parameters

$i
$propertyPath
$value
$constraints
$group

protected assertNoViolation()

protected ConstraintViolationAssertion buildViolation($message)

Parameters

$message

Return Value

ConstraintViolationAssertion

abstract protected createValidator()

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Validator/Test/ConstraintValidatorTestCase.html