public function SmsFrameworkUserAccountRegistrationServiceTest::testIncomingPatternNoReply in SMS Framework 2.1.x
Same name and namespace in other branches
- 8 modules/sms_user/tests/src/Kernel/SmsFrameworkUserAccountRegistrationServiceTest.php \Drupal\Tests\sms_user\Kernel\SmsFrameworkUserAccountRegistrationServiceTest::testIncomingPatternNoReply()
- 2.x modules/sms_user/tests/src/Kernel/SmsFrameworkUserAccountRegistrationServiceTest.php \Drupal\Tests\sms_user\Kernel\SmsFrameworkUserAccountRegistrationServiceTest::testIncomingPatternNoReply()
Ensure no reply sent if turned off.
File
- modules/
sms_user/ tests/ src/ Kernel/ SmsFrameworkUserAccountRegistrationServiceTest.php, line 369
Class
- SmsFrameworkUserAccountRegistrationServiceTest
- Tests account registration.
Namespace
Drupal\Tests\sms_user\KernelCode
public function testIncomingPatternNoReply() {
$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', FALSE)
->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
->assertFalse($this
->inTestMessages($this->gateway, $reply_message));
}