You are here

public function PhoneFieldValidationRuleTest::testPhoneFieldMalformed in Field Validation 8

Tests malformed and empty phone input.

@dataProvider phoneNumbersProviderMalformed Data provider for malformed inputs.

Parameters

string $country: Country to test.

Throws

\Drupal\Core\Entity\EntityStorageException

File

tests/src/Kernel/Plugin/FieldValidationRule/PhoneFieldValidationRuleTest.php, line 150

Class

PhoneFieldValidationRuleTest
Tests PhoneFieldValidationRule.

Namespace

Drupal\Tests\field_validation\Kernel\Plugin\FieldValidationRule

Code

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