You are here

protected function SmsFrameworkUserAccountRegistrationServiceTest::sendIncomingMessage in SMS Framework 8

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

Send an incoming SMS message.

Parameters

string $sender_number: The sender phone number.

string $message: The message to send inwards.

20 calls to SmsFrameworkUserAccountRegistrationServiceTest::sendIncomingMessage()
SmsFrameworkUserAccountRegistrationServiceTest::testErrorBuilder in modules/sms_user/tests/src/Kernel/SmsFrameworkUserAccountRegistrationServiceTest.php
Test error builder.
SmsFrameworkUserAccountRegistrationServiceTest::testIncomingPatternActivateEmail in modules/sms_user/tests/src/Kernel/SmsFrameworkUserAccountRegistrationServiceTest.php
Ensure account activation email sent.
SmsFrameworkUserAccountRegistrationServiceTest::testIncomingPatternHasReply in modules/sms_user/tests/src/Kernel/SmsFrameworkUserAccountRegistrationServiceTest.php
Ensure reply sent if turned on.
SmsFrameworkUserAccountRegistrationServiceTest::testIncomingPatternMultiplePlaceholderFailure in modules/sms_user/tests/src/Kernel/SmsFrameworkUserAccountRegistrationServiceTest.php
Test if a duplicated placeholder is not confirmed.
SmsFrameworkUserAccountRegistrationServiceTest::testIncomingPatternMultiplePlaceholderSuccess in modules/sms_user/tests/src/Kernel/SmsFrameworkUserAccountRegistrationServiceTest.php
Test if a duplicated placeholder is confirmed.

... See full list

File

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

Class

SmsFrameworkUserAccountRegistrationServiceTest
Tests account registration.

Namespace

Drupal\Tests\sms_user\Kernel

Code

protected function sendIncomingMessage($sender_number, $message) {

  /** @var \Drupal\sms\Entity\SmsMessage $incoming */
  $incoming = SmsMessage::create()
    ->setSenderNumber($sender_number)
    ->setDirection(Direction::INCOMING)
    ->setMessage($message)
    ->addRecipients($this
    ->randomPhoneNumbers(1))
    ->setGateway($this->gateway);
  $incoming
    ->setResult($this
    ->createMessageResult($incoming));
  $this->smsProvider
    ->queue($incoming);
}