public function SmsFrameworkMessageTestTrait::testRecipientAdd in SMS Framework 8
Same name and namespace in other branches
- 2.x tests/src/Functional/SmsFrameworkMessageTestTrait.php \Drupal\Tests\sms\Functional\SmsFrameworkMessageTestTrait::testRecipientAdd()
- 2.1.x tests/src/Functional/SmsFrameworkMessageTestTrait.php \Drupal\Tests\sms\Functional\SmsFrameworkMessageTestTrait::testRecipientAdd()
Tests adding recipients to SMS messages.
@covers ::addRecipient
File
- tests/
src/ Functional/ SmsFrameworkMessageTestTrait.php, line 81
Class
- SmsFrameworkMessageTestTrait
- SMS Message object test trait.
Namespace
Drupal\Tests\sms\FunctionalCode
public function testRecipientAdd() {
$recipient1 = '123123123';
$recipient2 = '456456456';
$sms_message1 = $this
->createSmsMessage();
$sms_message1
->addRecipient($recipient1)
->addRecipient($recipient2);
$this
->assertEquals([
$recipient1,
$recipient2,
], $sms_message1
->getRecipients());
// Check duplicate recipients are not added.
$sms_message2 = $this
->createSmsMessage();
$sms_message2
->addRecipients([
$recipient1,
$recipient1,
$recipient1,
$recipient2,
]);
$this
->assertEquals([
$recipient1,
$recipient2,
], $sms_message2
->getRecipients());
}