You are here

protected function SmsFrameworkTestTrait::getTestMessageReport in SMS Framework 8

Same name and namespace in other branches
  1. 2.x tests/src/Functional/SmsFrameworkTestTrait.php \Drupal\Tests\sms\Functional\SmsFrameworkTestTrait::getTestMessageReport()
  2. 2.1.x tests/src/Functional/SmsFrameworkTestTrait.php \Drupal\Tests\sms\Functional\SmsFrameworkTestTrait::getTestMessageReport()

Gets an SMS report for message with message ID.

Parameters

string $message_id: The message ID.

\Drupal\sms\Entity\SmsGatewayInterface $sms_gateway: A gateway plugin.

Return value

\Drupal\sms\Message\SmsDeliveryReportInterface The last SMS message, or FALSE if no messages have been sent.

1 call to SmsFrameworkTestTrait::getTestMessageReport()
SmsFrameworkDeliveryReportTest::testDeliveryReports in tests/src/Functional/SmsFrameworkDeliveryReportTest.php
Tests delivery reports integration.

File

tests/src/Functional/SmsFrameworkTestTrait.php, line 190

Class

SmsFrameworkTestTrait
Shared SMS Framework helpers for kernel and web tests.

Namespace

Drupal\Tests\sms\Functional

Code

protected function getTestMessageReport($message_id, SmsGatewayInterface $sms_gateway) {
  $gateway_id = $sms_gateway
    ->id();
  $reports = \Drupal::state()
    ->get('sms_test_gateway.memory.report', []);
  return $reports[$gateway_id][$message_id];
}