You are here

public function SmsFrameworkDeliveryReportTestTrait::testRecipient in SMS Framework 8

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

Tests recipient.

@covers ::getRecipient @covers ::setRecipient

File

tests/src/Functional/SmsFrameworkDeliveryReportTestTrait.php, line 35

Class

SmsFrameworkDeliveryReportTestTrait
Provides common tests for SmsDeliveryReport object and entity classes.

Namespace

Drupal\Tests\sms\Functional

Code

public function testRecipient() {
  $report = $this
    ->createDeliveryReport();
  $this
    ->assertEquals('', $report
    ->getRecipient(), 'Default value is empty string');
  $recipient = $this
    ->getRandomGenerator()
    ->string();
  $return = $report
    ->setRecipient($recipient);
  $this
    ->assertTrue($return instanceof SmsDeliveryReportInterface);
  $this
    ->assertEquals($recipient, $report
    ->getRecipient());
}