You are here

public function SmsFrameworkMessageEntityTest::testSendTime in SMS Framework 8

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

Tests queue send time.

@covers ::getSendTime @covers ::setSendTime

File

tests/src/Kernel/SmsFrameworkMessageEntityTest.php, line 197

Class

SmsFrameworkMessageEntityTest
Tests SMS message entity.

Namespace

Drupal\Tests\sms\Kernel

Code

public function testSendTime() {
  $sms_message1 = $this
    ->createSmsMessage();
  $this
    ->assertEquals(REQUEST_TIME, $sms_message1
    ->getSendTime());
  $time = (new DrupalDateTime('+7 days'))
    ->format('U');
  $sms_message2 = $this
    ->createSmsMessage();
  $sms_message2
    ->setSendTime($time);
  $this
    ->assertEquals($time, $sms_message2
    ->getSendTime());
}