You are here

public function SmsFrameworkUserAccountRegistrationServiceTest::testUnrecognisedOffNoCreateUser in SMS Framework 8

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

Ensure incoming SMS does not create messages or users.

File

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

Class

SmsFrameworkUserAccountRegistrationServiceTest
Tests account registration.

Namespace

Drupal\Tests\sms_user\Kernel

Code

public function testUnrecognisedOffNoCreateUser() {
  $this
    ->config('sms_user.settings')
    ->set('account_registration.unrecognized_sender.status', 0)
    ->set('account_registration.unrecognized_sender.reply.status', 1)
    ->save();
  $this
    ->sendIncomingMessage('+123', $this
    ->randomString());
  $this
    ->assertEquals(0, count($this
    ->getTestMessages($this->gateway)), 'No messages were created');
  $this
    ->assertEquals(0, $this
    ->countUsers(), 'No users exist.');
}