protected function SmsFrameworkTestTrait::getLastTestMessageReport in SMS Framework 8
Same name and namespace in other branches
- 2.x tests/src/Functional/SmsFrameworkTestTrait.php \Drupal\Tests\sms\Functional\SmsFrameworkTestTrait::getLastTestMessageReport()
- 2.1.x tests/src/Functional/SmsFrameworkTestTrait.php \Drupal\Tests\sms\Functional\SmsFrameworkTestTrait::getLastTestMessageReport()
Gets the last SMS report for messages sent to 'Memory' gateway.
Parameters
\Drupal\sms\Entity\SmsGatewayInterface $sms_gateway: A gateway plugin.
Return value
\Drupal\sms\Message\SmsDeliveryReportInterface|false The last SMS message, or FALSE if no messages have been sent.
File
- tests/
src/ Functional/ SmsFrameworkTestTrait.php, line 173
Class
- SmsFrameworkTestTrait
- Shared SMS Framework helpers for kernel and web tests.
Namespace
Drupal\Tests\sms\FunctionalCode
protected function getLastTestMessageReport(SmsGatewayInterface $sms_gateway) {
$gateway_id = $sms_gateway
->id();
$sms_reports = \Drupal::state()
->get('sms_test_gateway.memory.report', []);
return isset($sms_reports[$gateway_id]) ? end($sms_reports[$gateway_id]) : FALSE;
}