You are here

protected function MigratePhoneNumberTestTrait::assertUnVerifiedPhoneNumber 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::assertUnVerifiedPhoneNumber()
  2. 2.1.x tests/src/Kernel/Migrate/MigratePhoneNumberTestTrait.php \Drupal\Tests\sms\Kernel\Migrate\MigratePhoneNumberTestTrait::assertUnVerifiedPhoneNumber()

Asserts that the specified user has an unverified phone number.

1 call to MigratePhoneNumberTestTrait::assertUnVerifiedPhoneNumber()
MigratePhoneNumberTestTrait::testPhoneNumberMigration in tests/src/Kernel/Migrate/MigratePhoneNumberTestTrait.php
Tests that the users' phone numbers verification status is migrated.

File

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

Class

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

Namespace

Drupal\Tests\sms\Kernel\Migrate

Code

protected function assertUnVerifiedPhoneNumber(UserInterface $user, $number) {
  $phone_numbers = $this->container
    ->get('sms.phone_number')
    ->getPhoneNumbers($user, FALSE);
  $phone_number = reset($phone_numbers);
  return $this
    ->assertEquals($number, $phone_number, "Phone number '{$number}' is unverified.");
}