You are here

public function IpFieldValidationRuleTest::testMaloformedAndEmptyIp in Field Validation 8

Tests empty and malformed input.

@dataProvider ipMalformedAndEmptyProvider

Parameters

string $version: Version of IP.

Throws

\Drupal\Core\Entity\EntityStorageException

File

tests/src/Kernel/Plugin/FieldValidationRule/IpFieldValidationRuleTest.php, line 142

Class

IpFieldValidationRuleTest
Tests IpFieldValidationRule.

Namespace

Drupal\Tests\field_validation\Kernel\Plugin\FieldValidationRule

Code

public function testMaloformedAndEmptyIp(string $version) {
  $this->ruleSet = $this
    ->updateSettings([
    'version' => $version,
  ], self::RULE_ID, self::RULE_TITLE, $this->ruleSet, self::FIELD_NAME);
  $this
    ->emptyAndMalformed(self::FIELD_NAME, $this->entity, $this->ruleSet);
}