You are here

public function MailchimpCampaignTest::testGetCampaign in Mailchimp 8

Same name and namespace in other branches
  1. 2.x modules/mailchimp_campaign/tests/src/Functional/MailchimpCampaignTest.php \Drupal\Tests\mailchimp_campaign\Functional\MailchimpCampaignTest::testGetCampaign()

Tests retrieval of a specific campaign.

File

modules/mailchimp_campaign/src/Tests/MailchimpCampaignTest.php, line 22

Class

MailchimpCampaignTest
Tests core campaign functionality.

Namespace

Drupal\Tests\mailchimp_campaign\Functional

Code

public function testGetCampaign() {
  $campaign_id = '42694e9e57';
  $campaign = mailchimp_get_campaign_data($campaign_id);
  $this
    ->assertTrue(is_object($campaign), 'Tested retrieval of campaign data.');
  $this
    ->assertEqual($campaign->id, $campaign_id);
  $this
    ->assertEqual($campaign->type, 'regular');
  $this
    ->assertEqual($campaign->recipients->list_id, '57afe96172');
  $this
    ->assertEqual($campaign->settings->subject_line, 'Test Campaign');
  $this
    ->assertTrue($campaign->tracking->html_clicks);
  $this
    ->assertFalse($campaign->tracking->text_clicks);
}