You are here

protected function TelephoneItemTest::setUp in Telephone Validation 8.2

Enable validation on telephone field.

Overrides TelephoneItemTest::setUp

File

tests/src/Kernel/TelephoneItemTest.php, line 27

Class

TelephoneItemTest
Test entity validation.

Namespace

Drupal\Tests\telephone_validation\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  $config = FieldConfig::loadByName('entity_test', 'entity_test', 'field_test');
  $config
    ->setThirdPartySetting('telephone_validation', 'format', PhoneNumberFormat::NATIONAL);
  $config
    ->setThirdPartySetting('telephone_validation', 'country', [
    'CA',
  ]);
  $config
    ->save();
}