public function SmsFrameworkProviderTest::testSendNoDirection in SMS Framework 2.x
Same name and namespace in other branches
- 8 tests/src/Kernel/SmsFrameworkProviderTest.php \Drupal\Tests\sms\Kernel\SmsFrameworkProviderTest::testSendNoDirection()
- 2.1.x tests/src/Kernel/SmsFrameworkProviderTest.php \Drupal\Tests\sms\Kernel\SmsFrameworkProviderTest::testSendNoDirection()
Ensures direction is set by the provider.
@covers ::send
File
- tests/
src/ Kernel/ SmsFrameworkProviderTest.php, line 103
Class
- SmsFrameworkProviderTest
- Tests SMS Framework provider service.
Namespace
Drupal\Tests\sms\KernelCode
public function testSendNoDirection() {
$sms_message = SmsMessage::create()
->setMessage($this
->randomString())
->addRecipients($this
->randomPhoneNumbers())
->setGateway($this->gateway);
// This method will set direction.
$this->smsProvider
->send($sms_message);
$messages = $this
->getTestMessages($this->gateway);
$this
->assertEquals(1, count($messages), 'Message was added to outgoing queue without direction being explicitly set');
$this
->assertEquals(Direction::OUTGOING, $messages[0]
->getDirection(), 'Message direction set to outgoing.');
}