You are here

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

Ensure escaped delimiters.

File

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

Class

SmsFrameworkUserAccountRegistrationServiceTest
Tests account registration.

Namespace

Drupal\Tests\sms_user\Kernel

Code

public function testIncomingPatternPlaceholderEscapedDelimiters() {

  // AccountRegistration::createAccount uses '/' delimiters. Ensure that they
  // are escaped otherwise a "preg_match_all(): Unknown modifier error" will
  // be thrown.
  $incoming_message = $this
    ->randomString() . '/';
  $this
    ->config('sms_user.settings')
    ->set('account_registration.incoming_pattern.status', 1)
    ->set('account_registration.incoming_pattern.incoming_messages.0', $incoming_message)
    ->save();
  $this
    ->sendIncomingMessage('+123123123', $this
    ->randomString());
}