You are here

public function SmsFrameworkQueueTest::testQueueNotDelayedScheduleAware in SMS Framework 2.x

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

Test message is not delayed for schedule aware gateways..

File

tests/src/Kernel/SmsFrameworkQueueTest.php, line 133

Class

SmsFrameworkQueueTest
Tests behaviour of SMS Framework message queue.

Namespace

Drupal\Tests\sms\Kernel

Code

public function testQueueNotDelayedScheduleAware() {
  $gateway = $this
    ->createMemoryGateway([
    'plugin' => 'memory_schedule_aware',
  ]);
  $sms_message = $this
    ->createSmsMessage()
    ->setSendTime(\Drupal::time()
    ->getRequestTime() + 9999)
    ->setGateway($gateway);
  $this->smsProvider
    ->queue($sms_message);
  $this->cronService
    ->run();
  $this
    ->assertEquals(1, count($this
    ->getTestMessages($gateway)), 'Message sent.');
}