public function SmsFrameworkDeliveryReportEntityTest::testTimeDelivered in SMS Framework 8
Same name and namespace in other branches
- 2.x tests/src/Kernel/SmsFrameworkDeliveryReportEntityTest.php \Drupal\Tests\sms\Kernel\SmsFrameworkDeliveryReportEntityTest::testTimeDelivered()
- 2.1.x tests/src/Kernel/SmsFrameworkDeliveryReportEntityTest.php \Drupal\Tests\sms\Kernel\SmsFrameworkDeliveryReportEntityTest::testTimeDelivered()
Tests time delivered.
@covers ::getTimeDelivered @covers ::setTimeDelivered
File
- tests/
src/ Kernel/ SmsFrameworkDeliveryReportEntityTest.php, line 93
Class
- SmsFrameworkDeliveryReportEntityTest
- Tests the SMS Delivery report entity.
Namespace
Drupal\Tests\sms\KernelCode
public function testTimeDelivered() {
$report = $this
->createDeliveryReport();
$this
->assertNull($report
->getTimeQueued(), 'Default value is NULL');
// Save a version that has DELIVERED as the status.
$sms_message = SmsMessage::create();
$sms_message
->save();
$time = 123123123;
$report
->setSmsMessage($sms_message)
->setStatus(SmsMessageReportStatus::DELIVERED)
->setStatusTime($time)
->save();
$return = $report
->setTimeDelivered($time);
$this
->assertTrue($return instanceof SmsDeliveryReportInterface);
$this
->assertEquals($time, $report
->getTimeDelivered());
}