protected function SmsFrameworkTestTrait::randomSmsMessage in SMS Framework 8
Same name and namespace in other branches
- 2.x tests/src/Functional/SmsFrameworkTestTrait.php \Drupal\Tests\sms\Functional\SmsFrameworkTestTrait::randomSmsMessage()
- 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 303
Class
- SmsFrameworkTestTrait
- Shared SMS Framework helpers for kernel and web tests.
Namespace
Drupal\Tests\sms\FunctionalCode
protected function randomSmsMessage($uid = 1) {
$phone_numbers = $this
->randomPhoneNumbers(1);
return new SmsMessage($phone_numbers[0], $this
->randomPhoneNumbers(), $this
->randomString(), [], $uid);
}