'constraints' =>
$constraints,
]));
} public function testConstraintsAreExecutedWithObject() { $number =
new \
stdClass();
$number->type = 'positive';
$number->value = 1;
$this->
setObject($number);
$this->
setPropertyPath('value'
);
$constraints =
[ new PositiveOrZero(),
];
$this->
expectValidateValue(0,
$number->value,
$constraints);
$this->validator->
validate($number->value,
new When([ 'expression' => 'this.type === "positive"',
'constraints' =>
$constraints,
]));
}