function ConstraintValidatorTestCase::setUp
Overrides TestCase::setUp
File
-
vendor/
symfony/ validator/ Test/ ConstraintValidatorTestCase.php, line 68
Class
- ConstraintValidatorTestCase
- A test case to ease testing Constraint Validators.
Namespace
Symfony\Component\Validator\TestCode
protected function setUp() : void {
$this->group = 'MyGroup';
$this->metadata = null;
$this->object = null;
$this->value = 'InvalidValue';
$this->root = 'root';
$this->propertyPath = 'property.path';
// Initialize the context with some constraint so that we can
// successfully build a violation.
$this->constraint = new NotNull();
$this->context = $this->createContext();
$this->validator = $this->createValidator();
$this->validator
->initialize($this->context);
if (class_exists(\Locale::class)) {
$this->defaultLocale = \Locale::getDefault();
\Locale::setDefault('en');
}
$this->expectedViolations = [];
$this->call = 0;
$this->setDefaultTimezone('UTC');
}