You are here

public function MigratePhoneNumberTestTrait::testPhoneSettingsMigrationWithCustomVerificationMessage in SMS Framework 8

Same name and namespace in other branches
  1. 2.x tests/src/Kernel/Migrate/MigratePhoneNumberTestTrait.php \Drupal\Tests\sms\Kernel\Migrate\MigratePhoneNumberTestTrait::testPhoneSettingsMigrationWithCustomVerificationMessage()
  2. 2.1.x tests/src/Kernel/Migrate/MigratePhoneNumberTestTrait.php \Drupal\Tests\sms\Kernel\Migrate\MigratePhoneNumberTestTrait::testPhoneSettingsMigrationWithCustomVerificationMessage()

Tests phone number migration with custom phone number verification message.

File

tests/src/Kernel/Migrate/MigratePhoneNumberTestTrait.php, line 60

Class

MigratePhoneNumberTestTrait
This trait executes tests for D6 and D7 SMS Framework migrations.

Namespace

Drupal\Tests\sms\Kernel\Migrate

Code

public function testPhoneSettingsMigrationWithCustomVerificationMessage() {
  $this
    ->loadFixture($this
    ->confirmationMessageFixturePath());

  // Execute the phone number settings migration and confirm.
  $this
    ->executeMigration('phone_number_settings');
  $settings = PhoneNumberSettings::loadMultiple();
  $this
    ->assertEquals(1, count($settings));

  /** @var \Drupal\sms\Entity\PhoneNumberSettingsInterface $setting */
  $setting = reset($settings);
  $expected_message = 'This is a custom confirmation message from [site:name]. Confirmation code: [sms-message:verification-code]';
  $this
    ->assertEquals($expected_message, $setting
    ->getVerificationMessage());
}