You are here

protected function SmsFrameworkTestTrait::randomSmsMessage in SMS Framework 2.x

Same name and namespace in other branches
  1. 8 tests/src/Functional/SmsFrameworkTestTrait.php \Drupal\Tests\sms\Functional\SmsFrameworkTestTrait::randomSmsMessage()
  2. 2.1.x tests/src/Functional/SmsFrameworkTestTrait.php \Drupal\Tests\sms\Functional\SmsFrameworkTestTrait::randomSmsMessage()

Generates a random SMS message by the specified user.

Parameters

int $uid: (optional) The user ID to generate the message as. Defaults to 1.

Return value

\Drupal\sms\Message\SmsMessageInterface A random SMS message by the specified user.

File

tests/src/Functional/SmsFrameworkTestTrait.php, line 304

Class

SmsFrameworkTestTrait
Shared SMS Framework helpers for kernel and web tests.

Namespace

Drupal\Tests\sms\Functional

Code

protected function randomSmsMessage($uid = 1) {
  $phone_numbers = $this
    ->randomPhoneNumbers(1);
  return new SmsMessage($phone_numbers[0], $this
    ->randomPhoneNumbers(), $this
    ->randomString(), [], $uid);
}