You are here

public function SmsFrameworkMessageResultTestTrait::testGetReport in SMS Framework 8

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

Tests get report for a recipient.

@covers ::getReport

File

tests/src/Functional/SmsFrameworkMessageResultTestTrait.php, line 54

Class

SmsFrameworkMessageResultTestTrait
Provides common tests for SmsMessageResult object and entity classes.

Namespace

Drupal\Tests\sms\Functional

Code

public function testGetReport() {
  $result = $this
    ->createMessageResult();
  $recipient = '123123123';
  $this
    ->assertNull($result
    ->getReport($recipient), 'No report found');
  $report = (new SmsDeliveryReport())
    ->setRecipient($recipient);
  $result
    ->setReports([
    $report,
  ]);
  $this
    ->assertTrue($result
    ->getReport($recipient) instanceof SmsDeliveryReportInterface, 'Report found');
}