protected function MigratePhoneNumberTestTrait::assertVerifiedPhoneNumber in SMS Framework 8
Same name and namespace in other branches
- 2.x tests/src/Kernel/Migrate/MigratePhoneNumberTestTrait.php \Drupal\Tests\sms\Kernel\Migrate\MigratePhoneNumberTestTrait::assertVerifiedPhoneNumber()
- 2.1.x tests/src/Kernel/Migrate/MigratePhoneNumberTestTrait.php \Drupal\Tests\sms\Kernel\Migrate\MigratePhoneNumberTestTrait::assertVerifiedPhoneNumber()
Asserts that the specified user has a verified phone number.
2 calls to MigratePhoneNumberTestTrait::assertVerifiedPhoneNumber()
- MigratePhoneNumberTestTrait::testPhoneNumberMigration in tests/
src/ Kernel/ Migrate/ MigratePhoneNumberTestTrait.php - Tests that the users' phone numbers verification status is migrated.
- MigratePhoneNumberTestTrait::testRollBack in tests/
src/ Kernel/ Migrate/ MigratePhoneNumberTestTrait.php - Tests that conditions are reverted after rollback.
File
- tests/
src/ Kernel/ Migrate/ MigratePhoneNumberTestTrait.php, line 143
Class
- MigratePhoneNumberTestTrait
- This trait executes tests for D6 and D7 SMS Framework migrations.
Namespace
Drupal\Tests\sms\Kernel\MigrateCode
protected function assertVerifiedPhoneNumber(UserInterface $user, $number) {
$phone_numbers = $this->container
->get('sms.phone_number')
->getPhoneNumbers($user, TRUE);
$phone_number = reset($phone_numbers);
return $this
->assertEquals($number, $phone_number, "Phone number '{$number}' is verified.");
}