You are here

public function SmsFrameworkProviderTest::testQueueBasic in SMS Framework 8

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

Test message is saved.

File

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

Class

SmsFrameworkProviderTest
Tests SMS Framework provider service.

Namespace

Drupal\Tests\sms\Kernel

Code

public function testQueueBasic() {
  $sms_message = $this
    ->createSmsMessage()
    ->addRecipients($this
    ->randomPhoneNumbers());
  $return = $this->smsProvider
    ->queue($sms_message);
  $this
    ->assertEquals(1, count(SmsMessage::loadMultiple()), 'SMS message saved.');
  $this
    ->assertEquals(1, count($return));
  $this
    ->assertTrue($return[0] instanceof SmsMessageInterface);
}