function LinkTypeConstraintValidatorTest::testUnexpectedValue
Same name and namespace in other branches
- 11.x core/modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkTypeConstraintValidatorTest.php \Drupal\Tests\link\Unit\Plugin\Validation\Constraint\LinkTypeConstraintValidatorTest::testUnexpectedValue()
Tests validating a value that isn't a LinkItemInterface.
File
-
core/
modules/ link/ tests/ src/ Unit/ Plugin/ Validation/ Constraint/ LinkTypeConstraintValidatorTest.php, line 174
Class
- LinkTypeConstraintValidatorTest
- Tests LinkTypeConstraintValidator.
Namespace
Drupal\Tests\link\Unit\Plugin\Validation\ConstraintCode
public function testUnexpectedValue() : void {
$this->expectException(UnexpectedValueException::class);
$context = $this->createStub(ExecutionContextInterface::class);
$this->doValidate('bad value', $context);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.