public function SmsFrameworkProviderTest::testNoSendNoRecipients in SMS Framework 2.1.x
Same name and namespace in other branches
- 8 tests/src/Kernel/SmsFrameworkProviderTest.php \Drupal\Tests\sms\Kernel\SmsFrameworkProviderTest::testNoSendNoRecipients()
- 2.x tests/src/Kernel/SmsFrameworkProviderTest.php \Drupal\Tests\sms\Kernel\SmsFrameworkProviderTest::testNoSendNoRecipients()
Ensure no messages sent if no recipients.
File
- tests/
src/ Kernel/ SmsFrameworkProviderTest.php, line 181
Class
- SmsFrameworkProviderTest
- Tests SMS Framework provider service.
Namespace
Drupal\Tests\sms\KernelCode
public function testNoSendNoRecipients() {
$sms_message = SmsMessage::create()
->setDirection(Direction::OUTGOING)
->setMessage($this
->randomString());
$this
->expectException(RecipientRouteException::class);
$this
->expectExceptionMessage('There are no recipients');
$this->smsProvider
->send($sms_message);
$this
->assertEquals(0, count($this
->getTestMessages($this->gateway)));
}