You are here

public function MailchimpCampaignsTestCase::testGetCampaign in Mailchimp 7.5

Same name and namespace in other branches
  1. 7.3 modules/mailchimp_campaign/tests/mailchimp_campaigns.test \MailchimpCampaignsTestCase::testGetCampaign()
  2. 7.4 modules/mailchimp_campaign/tests/mailchimp_campaigns.test \MailchimpCampaignsTestCase::testGetCampaign()

Tests retrieval of a specific campaign.

File

modules/mailchimp_campaign/tests/mailchimp_campaigns.test, line 61
Test class and methods for the Mailchimp Campaigns module.

Class

MailchimpCampaignsTestCase
@file Test class and methods for the Mailchimp Campaigns module.

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);
}