You are here

public function SmsFrameworkUserAccountRegistrationServiceTest::testIncomingPatternHasReply 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::testIncomingPatternHasReply()
  2. 2.1.x modules/sms_user/tests/src/Kernel/SmsFrameworkUserAccountRegistrationServiceTest.php \Drupal\Tests\sms_user\Kernel\SmsFrameworkUserAccountRegistrationServiceTest::testIncomingPatternHasReply()

Ensure reply sent if turned on.

File

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

Class

SmsFrameworkUserAccountRegistrationServiceTest
Tests account registration.

Namespace

Drupal\Tests\sms_user\Kernel

Code

public function testIncomingPatternHasReply() {
  $reply_message = $this
    ->randomString();
  $this
    ->config('sms_user.settings')
    ->set('account_registration.incoming_pattern.status', TRUE)
    ->set('account_registration.incoming_pattern.incoming_messages.0', "[username] [password]")
    ->set('account_registration.incoming_pattern.reply.status', TRUE)
    ->set('account_registration.incoming_pattern.reply.message', $reply_message)
    ->save();
  $incoming_message = $this
    ->randomMachineName() . ' ' . $this
    ->randomMachineName();
  $this
    ->sendIncomingMessage('+123123123', $incoming_message);
  $this
    ->assertEquals(1, $this
    ->countUsers(), 'User created');
  $this
    ->assertTrue($this
    ->inTestMessages($this->gateway, $reply_message));
}