You are here

public function MandrillReportsTestCase::testGetReportsData in Mandrill 8

Tests getting Mandrill reports data.

File

modules/mandrill_reports/tests/src/Functional/MandrillReportsTestCase.php, line 41
Test class and methods for the Mandrill Reports module.

Class

MandrillReportsTestCase
Test Mandrill Reports functionality.

Namespace

Drupal\mandrill_reports\Tests

Code

public function testGetReportsData() {

  /* @var $reports \Drupal\mandrill_reports\MandrillReportsService */
  $reports = \Drupal::service('mandrill_reports.test.service');
  $reports_data = array(
    'user' => $reports
      ->getUser(),
    'tags' => $reports
      ->getTags(),
    'all_time_series' => $reports
      ->getTagsAllTimeSeries(),
    'senders' => $reports
      ->getSenders(),
    'urls' => $reports
      ->getUrls(),
  );
  $this
    ->assertTrue(!empty($reports_data['user']), 'Tested user report data exists.');
  $this
    ->assertTrue(!empty($reports_data['tags']), 'Tested tags report data exists.');
  $this
    ->assertTrue(!empty($reports_data['all_time_series']), 'Tested all time series report data exists.');
  $this
    ->assertTrue(!empty($reports_data['senders']), 'Tested senders report data exists.');
  $this
    ->assertTrue(!empty($reports_data['urls']), 'Tested URLs report data exists.');
}