public function RangeFromGreaterToConstraintValidatorTest::testInvalidValueType in Range 8
@covers ::validate
File
- tests/
src/ Unit/ Plugin/ Validation/ Constraint/ RangeFromGreaterToConstraintValidatorTest.php, line 81
Class
- RangeFromGreaterToConstraintValidatorTest
- Tests the RangeFromGreaterToConstraintValidator validator.
Namespace
Drupal\Tests\range\Unit\Plugin\Validation\ConstraintCode
public function testInvalidValueType() {
$context = $this
->createMock(ExecutionContextInterface::class);
$constraint = new RangeFromGreaterToConstraint();
$validate = new RangeFromGreaterToConstraintValidator();
$validate
->initialize($context);
$this
->expectException(UnexpectedTypeException::class);
$validate
->validate(new \stdClass(), $constraint);
}