public function SmsFrameworkProviderTest::testSend in SMS Framework 2.1.x
Same name and namespace in other branches
- 8 tests/src/Kernel/SmsFrameworkProviderTest.php \Drupal\Tests\sms\Kernel\SmsFrameworkProviderTest::testSend()
- 2.x tests/src/Kernel/SmsFrameworkProviderTest.php \Drupal\Tests\sms\Kernel\SmsFrameworkProviderTest::testSend()
Test message is sent immediately.
@covers ::send
File
- tests/
src/ Kernel/ SmsFrameworkProviderTest.php, line 86
Class
- SmsFrameworkProviderTest
- Tests SMS Framework provider service.
Namespace
Drupal\Tests\sms\KernelCode
public function testSend() {
$message = $this
->createSmsMessage()
->addRecipients($this
->randomPhoneNumbers());
$sms_messages = $this->smsProvider
->send($message);
$this
->assertEquals(1, count($sms_messages), 'Return value contains 1 item.');
$this
->assertTrue($sms_messages[0] instanceof StandardSmsMessageInterface, 'Return value is a SMS message.');
$this
->assertEquals(1, count($this
->getTestMessages($this->gateway)));
$this
->assertTrue($sms_messages[0]
->getResult() instanceof SmsMessageResultInterface);
}