You are here

public function SmsFrameworkUserAccountRegistrationServiceTest::testUnrecognisedNoEmail in SMS Framework 2.1.x

Same name and namespace in other branches
  1. 8 modules/sms_user/tests/src/Kernel/SmsFrameworkUserAccountRegistrationServiceTest.php \Drupal\Tests\sms_user\Kernel\SmsFrameworkUserAccountRegistrationServiceTest::testUnrecognisedNoEmail()
  2. 2.x modules/sms_user/tests/src/Kernel/SmsFrameworkUserAccountRegistrationServiceTest.php \Drupal\Tests\sms_user\Kernel\SmsFrameworkUserAccountRegistrationServiceTest::testUnrecognisedNoEmail()

Test if a user is created despite no email address.

File

modules/sms_user/tests/src/Kernel/SmsFrameworkUserAccountRegistrationServiceTest.php, line 212

Class

SmsFrameworkUserAccountRegistrationServiceTest
Tests account registration.

Namespace

Drupal\Tests\sms_user\Kernel

Code

public function testUnrecognisedNoEmail() {
  $this
    ->config('sms_user.settings')
    ->set('account_registration.unrecognized_sender.status', 1)
    ->save();
  $this
    ->assertEquals(0, $this
    ->countUsers());
  $this
    ->sendIncomingMessage('+123123123', $this
    ->randomString());
  $this
    ->assertFalse(empty($this
    ->getLastUser()
    ->getAccountName()));
  $this
    ->assertTrue(empty($this
    ->getLastUser()
    ->getEmail()));
}