You are here

public function SmsFrameworkProviderTest::testQueueNoDirection in SMS Framework 8

Same name and namespace in other branches
  1. 2.x tests/src/Kernel/SmsFrameworkProviderTest.php \Drupal\Tests\sms\Kernel\SmsFrameworkProviderTest::testQueueNoDirection()
  2. 2.1.x tests/src/Kernel/SmsFrameworkProviderTest.php \Drupal\Tests\sms\Kernel\SmsFrameworkProviderTest::testQueueNoDirection()

Ensures exception if missing direction for queue method.

@covers ::queue

File

tests/src/Kernel/SmsFrameworkProviderTest.php, line 204

Class

SmsFrameworkProviderTest
Tests SMS Framework provider service.

Namespace

Drupal\Tests\sms\Kernel

Code

public function testQueueNoDirection() {
  $sms_message = SmsMessage::create()
    ->setMessage($this
    ->randomString())
    ->addRecipients($this
    ->randomPhoneNumbers());
  $this
    ->setExpectedException(SmsDirectionException::class, 'Missing direction for message.');
  $this->smsProvider
    ->queue($sms_message);
}