You are here

public function SmsFrameworkMessageTestTrait::testRecipientRemove in SMS Framework 8

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

Tests removing recipients from SMS messages.

@covers ::removeRecipient

File

tests/src/Functional/SmsFrameworkMessageTestTrait.php, line 116

Class

SmsFrameworkMessageTestTrait
SMS Message object test trait.

Namespace

Drupal\Tests\sms\Functional

Code

public function testRecipientRemove() {
  $recipient1 = '123123123';
  $recipient2 = '456456456';
  $sms_message1 = $this
    ->createSmsMessage();
  $sms_message1
    ->addRecipient($recipient1)
    ->addRecipient($recipient2);
  $sms_message1
    ->removeRecipient($recipient1);
  $this
    ->assertEquals([
    $recipient2,
  ], $sms_message1
    ->getRecipients());
}