public function PlainTextFieldValidationRuleTest::testPlainTextRule in Field Validation 8
Test callback.
File
- tests/
src/ Kernel/ Plugin/ FieldValidationRule/ PlainTextFieldValidationRuleTest.php, line 81
Class
- PlainTextFieldValidationRuleTest
- Tests PlainTextFieldValidationRule.
Namespace
Drupal\Tests\field_validation\Kernel\Plugin\FieldValidationRuleCode
public function testPlainTextRule() {
$this
->assertConstraintPass($this->entity, self::FIELD_NAME, 'i am a plain text!');
$this
->assertConstraintFail($this->entity, self::FIELD_NAME, '<i>i am not plain text </i>', $this->ruleSet);
}