You are here

public function SmsFrameworkUserAccountRegistrationServiceTest::testUnrecognisedNoReply in SMS Framework 2.x

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

Ensure no reply sent if turned off.

File

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

Class

SmsFrameworkUserAccountRegistrationServiceTest
Tests account registration.

Namespace

Drupal\Tests\sms_user\Kernel

Code

public function testUnrecognisedNoReply() {
  $reply_message = $this
    ->randomString();
  $this
    ->config('sms_user.settings')
    ->set('account_registration.unrecognized_sender.status', TRUE)
    ->set('account_registration.unrecognized_sender.reply.status', FALSE)
    ->set('account_registration.unrecognized_sender.reply.message', $reply_message)
    ->save();
  $this
    ->sendIncomingMessage('+123123123', $this
    ->randomString());
  $this
    ->assertEquals(1, $this
    ->countUsers(), 'User created');
  $this
    ->assertFalse($this
    ->inTestMessages($this->gateway, $reply_message));
}