You are here

public function SmsFrameworkUserAccountRegistrationServiceTest::inTestMessages in SMS Framework 2.x

Same name and namespace in other branches
  1. 8 modules/sms_user/tests/src/Kernel/SmsFrameworkUserAccountRegistrationServiceTest.php \Drupal\Tests\sms_user\Kernel\SmsFrameworkUserAccountRegistrationServiceTest::inTestMessages()
  2. 2.1.x modules/sms_user/tests/src/Kernel/SmsFrameworkUserAccountRegistrationServiceTest.php \Drupal\Tests\sms_user\Kernel\SmsFrameworkUserAccountRegistrationServiceTest::inTestMessages()

Check if the message body can be found in the test message memory buffer.

Parameters

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

string $message: The message to check.

Return value

bool Whether message was found in any memory messages.

5 calls to SmsFrameworkUserAccountRegistrationServiceTest::inTestMessages()
SmsFrameworkUserAccountRegistrationServiceTest::testIncomingPatternHasReply in modules/sms_user/tests/src/Kernel/SmsFrameworkUserAccountRegistrationServiceTest.php
Ensure reply sent if turned on.
SmsFrameworkUserAccountRegistrationServiceTest::testIncomingPatternNoReply in modules/sms_user/tests/src/Kernel/SmsFrameworkUserAccountRegistrationServiceTest.php
Ensure no reply sent if turned off.
SmsFrameworkUserAccountRegistrationServiceTest::testReplyTokens in modules/sms_user/tests/src/Kernel/SmsFrameworkUserAccountRegistrationServiceTest.php
Ensure non-global tokens and [user:password] are replaced in reply message.
SmsFrameworkUserAccountRegistrationServiceTest::testUnrecognisedGotReply in modules/sms_user/tests/src/Kernel/SmsFrameworkUserAccountRegistrationServiceTest.php
Ensure reply sent if turned on.
SmsFrameworkUserAccountRegistrationServiceTest::testUnrecognisedNoReply in modules/sms_user/tests/src/Kernel/SmsFrameworkUserAccountRegistrationServiceTest.php
Ensure no reply sent if turned off.

File

modules/sms_user/tests/src/Kernel/SmsFrameworkUserAccountRegistrationServiceTest.php, line 568

Class

SmsFrameworkUserAccountRegistrationServiceTest
Tests account registration.

Namespace

Drupal\Tests\sms_user\Kernel

Code

public function inTestMessages(SmsGatewayInterface $sms_gateway, $message) {
  foreach ($this
    ->getTestMessages($sms_gateway) as $sms_message) {
    if ($sms_message
      ->getMessage() == $message) {
      return TRUE;
    }
  }
  return FALSE;
}