protected function SmsFrameworkTestTrait::randomPhoneNumbers in SMS Framework 8
Same name and namespace in other branches
- 2.x tests/src/Functional/SmsFrameworkTestTrait.php \Drupal\Tests\sms\Functional\SmsFrameworkTestTrait::randomPhoneNumbers()
- 2.1.x tests/src/Functional/SmsFrameworkTestTrait.php \Drupal\Tests\sms\Functional\SmsFrameworkTestTrait::randomPhoneNumbers()
Generates random phone numbers for tests.
Parameters
int|null $quantity: Quantity of phone numbers, or NULL to generate at least 2.
Return value
array An array of phone numbers.
24 calls to SmsFrameworkTestTrait::randomPhoneNumbers()
- SmsBlastBrowserTest::testSendBlast in modules/
sms_blast/ tests/ src/ Functional/ SmsBlastBrowserTest.php - Tests sending SMS blast.
- SmsFrameworkBrowserTest::testQueueReport in tests/
src/ Functional/ SmsFrameworkBrowserTest.php - Tests queue statistics located on Drupal report page.
- SmsFrameworkIncomingBrowserTest::testIncomingRouteEndpoint in tests/
src/ Functional/ SmsFrameworkIncomingBrowserTest.php - Test incoming route endpoint provided by 'incoming' gateway.
- SmsFrameworkMessageEntityTest::testConvertToEntityFromStandardSmsMessage in tests/
src/ Kernel/ SmsFrameworkMessageEntityTest.php - Ensure data from standard SMS message are passed to SMS message entity.
- SmsFrameworkProcessorTest::testIncomingMissingGateway in tests/
src/ Kernel/ SmsFrameworkProcessorTest.php - Tests exception is thrown if gateway is not set on incoming messages.
File
- tests/
src/ Functional/ SmsFrameworkTestTrait.php, line 317
Class
- SmsFrameworkTestTrait
- Shared SMS Framework helpers for kernel and web tests.
Namespace
Drupal\Tests\sms\FunctionalCode
protected function randomPhoneNumbers($quantity = NULL) {
$quantity = isset($quantity) ? $quantity : rand(2, 20);
$numbers = [];
for ($i = 0; $i < $quantity; $i++) {
$numbers[] = '+' . rand(1000, 999999999);
}
return $numbers;
}