protected function SmsFrameworkTestTrait::getIncomingMessages in SMS Framework 8
Same name and namespace in other branches
- 2.x tests/src/Functional/SmsFrameworkTestTrait.php \Drupal\Tests\sms\Functional\SmsFrameworkTestTrait::getIncomingMessages()
- 2.1.x tests/src/Functional/SmsFrameworkTestTrait.php \Drupal\Tests\sms\Functional\SmsFrameworkTestTrait::getIncomingMessages()
Get all messages received by a gateway.
Parameters
\Drupal\sms\Entity\SmsGatewayInterface $sms_gateway: A gateway plugin instance.
Return value
\Drupal\sms\Message\SmsMessageInterface[] An array of messages received by a gateway.
4 calls to SmsFrameworkTestTrait::getIncomingMessages()
- SmsFrameworkIncomingBrowserTest::testIncomingRouteEndpoint in tests/
src/ Functional/ SmsFrameworkIncomingBrowserTest.php - Test incoming route endpoint provided by 'incoming' gateway.
- SmsFrameworkProviderTest::testIncomingNoDirection in tests/
src/ Kernel/ SmsFrameworkProviderTest.php - Ensures direction is set by the provider.
- SmsFrameworkProviderTest::testIncomingNoRecipients in tests/
src/ Kernel/ SmsFrameworkProviderTest.php - Ensures incoming message without recipients do not trigger exception.
- SmsFrameworkProviderTest::testIncomingNotChunked in tests/
src/ Kernel/ SmsFrameworkProviderTest.php - Test incoming messages do not get chunked.
File
- tests/
src/ Functional/ SmsFrameworkTestTrait.php, line 111
Class
- SmsFrameworkTestTrait
- Shared SMS Framework helpers for kernel and web tests.
Namespace
Drupal\Tests\sms\FunctionalCode
protected function getIncomingMessages(SmsGatewayInterface $sms_gateway) {
$gateway_id = $sms_gateway
->id();
$sms_messages = \Drupal::state()
->get('sms_test_gateway.memory.incoming', []);
return isset($sms_messages[$gateway_id]) ? $sms_messages[$gateway_id] : [];
}