use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
class ConstraintValidatorTestCaseTest extends ConstraintValidatorTestCase
{ protected function createValidator(): TestCustomValidator
{ return new TestCustomValidator();
} public function testAssertingContextualValidatorRemainingExpectationsThrow() { $this->
expectValidateValueAt(0, 'k1', 'ccc',
[ new NotNull(),
]);
$this->
expectValidateValueAt(1, 'k2', 'ccc',
[ new DateTime(),
]);
$this->validator->
validate('ccc',
$this->constraint
);
$contextualValidator =
$this->context->
getValidator()->
inContext($this->context
);
// Simulate __destruct to assert it throws
try {