You are here

public function SmsFrameworkMessageTestTrait::testRecipientsRemove in SMS Framework 8

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

Tests removing multiple recipients from SMS messages.

@covers ::removeRecipients

File

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

Class

SmsFrameworkMessageTestTrait
SMS Message object test trait.

Namespace

Drupal\Tests\sms\Functional

Code

public function testRecipientsRemove() {

  // Test multiple recipient remove.
  $recipients = [
    '123123123',
    '456456456',
    '234234234',
  ];
  $sms_message = $this
    ->createSmsMessage();
  $sms_message
    ->addRecipients($recipients);
  $this
    ->assertEquals($recipients, $sms_message
    ->getRecipients());
  $sms_message
    ->removeRecipients([
    '123123123',
    '234234234',
  ]);
  $this
    ->assertEquals([
    '456456456',
  ], $sms_message
    ->getRecipients());
}