You are here

public function SmsFrameworkTestTrait::getTestMessages in SMS Framework 8

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

Get all SMS messages sent to a 'Memory' gateway.

Parameters

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

Return value

\Drupal\sms\Message\SmsMessageInterface[] An array of SMS messages sent to a 'Memory' gateway.

22 calls to SmsFrameworkTestTrait::getTestMessages()
SmsBlastBrowserTest::testSendBlast in modules/sms_blast/tests/src/Functional/SmsBlastBrowserTest.php
Tests sending SMS blast.
SmsDevelMessageTest::testNoFallbackGateway in modules/sms_devel/tests/src/Functional/SmsDevelMessageTest.php
Tests error shown if gateway found for message.
SmsDevelMessageTest::testSendSkipQueue in modules/sms_devel/tests/src/Functional/SmsDevelMessageTest.php
Tests sending functionality skipping queue.
SmsFrameworkPhoneNumberProviderTest::testSendMessageVerified in tests/src/Kernel/SmsFrameworkPhoneNumberProviderTest.php
Tests SMS message sent to entities with verified phone number.
SmsFrameworkPhoneNumberVerificationTest::testNewPhoneVerification in tests/src/Kernel/SmsFrameworkPhoneNumberVerificationTest.php
Tests creating new verification for an entity.

... See full list

File

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

Class

SmsFrameworkTestTrait
Shared SMS Framework helpers for kernel and web tests.

Namespace

Drupal\Tests\sms\Functional

Code

public function getTestMessages(SmsGatewayInterface $sms_gateway) {
  $gateway_id = $sms_gateway
    ->id();
  $sms_messages = \Drupal::state()
    ->get('sms_test_gateway.memory.send', []);
  return isset($sms_messages[$gateway_id]) ? $sms_messages[$gateway_id] : [];
}