You are here

public function SmsFrameworkProcessorTest::testIncomingMissingGateway in SMS Framework 8

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

Tests exception is thrown if gateway is not set on incoming messages.

@covers ::ensureIncomingSupport

File

tests/src/Kernel/SmsFrameworkProcessorTest.php, line 161

Class

SmsFrameworkProcessorTest
Tests functionality provided by the SMS message event subscriber.

Namespace

Drupal\Tests\sms\Kernel

Code

public function testIncomingMissingGateway() {
  $sms_message = SmsMessage::create()
    ->setDirection(Direction::INCOMING)
    ->setMessage($this
    ->randomString())
    ->addRecipients($this
    ->randomPhoneNumbers());
  $this
    ->setExpectedException(SmsException::class, 'Gateway not set on incoming message');
  $this->smsProvider
    ->queue($sms_message);
}