public function IpFieldValidationRuleTest::testInvalidIpRule in Field Validation 8
Tests Invalid ip inputs.
@dataProvider ipInvalidProvider
Parameters
string $version: IP version.
string $value: Value to test.
Throws
\Drupal\Core\Entity\EntityStorageException
File
- tests/
src/ Kernel/ Plugin/ FieldValidationRule/ IpFieldValidationRuleTest.php, line 116
Class
- IpFieldValidationRuleTest
- Tests IpFieldValidationRule.
Namespace
Drupal\Tests\field_validation\Kernel\Plugin\FieldValidationRuleCode
public function testInvalidIpRule(string $version, string $value) {
$this->ruleSet = $this
->updateSettings([
'version' => $version,
], self::RULE_ID, self::RULE_TITLE, $this->ruleSet, self::FIELD_NAME);
$this
->assertConstraintFail($this->entity, self::FIELD_NAME, $value, $this->ruleSet);
}