You are here

public function MustBeEmptyFieldValidationRuleTest::testEmptyField in Field Validation 8

Tests MustBeEmptyFieldValidationRule plugin.

File

tests/src/Kernel/Plugin/FieldValidationRule/MustBeEmptyFieldValidationRuleTest.php, line 78

Class

MustBeEmptyFieldValidationRuleTest
Tests MustBeEmptyFieldValidationRule.

Namespace

Drupal\Tests\field_validation\Kernel\Plugin\FieldValidationRule

Code

public function testEmptyField() {
  $this
    ->assertConstraintFail($this->entity, self::FIELD_NAME, 'I am groot!', $this->ruleSet);
  $this
    ->assertConstraintPass($this->entity, self::FIELD_NAME, '');
}