public function SmsFrameworkUserAccountRegistrationServiceTest::testUniqueUsername in SMS Framework 2.x
Same name and namespace in other branches
- 8 modules/sms_user/tests/src/Kernel/SmsFrameworkUserAccountRegistrationServiceTest.php \Drupal\Tests\sms_user\Kernel\SmsFrameworkUserAccountRegistrationServiceTest::testUniqueUsername()
- 2.1.x modules/sms_user/tests/src/Kernel/SmsFrameworkUserAccountRegistrationServiceTest.php \Drupal\Tests\sms_user\Kernel\SmsFrameworkUserAccountRegistrationServiceTest::testUniqueUsername()
Test unique username.
@covers ::generateUniqueUsername
File
- modules/
sms_user/ tests/ src/ Kernel/ SmsFrameworkUserAccountRegistrationServiceTest.php, line 483
Class
- SmsFrameworkUserAccountRegistrationServiceTest
- Tests account registration.
Namespace
Drupal\Tests\sms_user\KernelCode
public function testUniqueUsername() {
$this
->config('sms_user.settings')
->set('account_registration.unrecognized_sender.status', 1)
->save();
$this
->sendIncomingMessage('+123123123', $this
->randomString());
$user1 = $this
->getLastUser();
$this
->sendIncomingMessage('+456456456', $this
->randomString());
$user2 = $this
->getLastUser();
$this
->assertNotEquals($user1
->getAccountName(), $user2
->getAccountName());
}