public function MailchimpCampaignTest::testGetCampaign in Mailchimp 2.x
Same name and namespace in other branches
- 8 modules/mailchimp_campaign/src/Tests/MailchimpCampaignTest.php \Drupal\Tests\mailchimp_campaign\Functional\MailchimpCampaignTest::testGetCampaign()
Tests retrieval of a specific campaign.
File
- modules/
mailchimp_campaign/ tests/ src/ Functional/ MailchimpCampaignTest.php, line 22
Class
- MailchimpCampaignTest
- Tests core campaign functionality.
Namespace
Drupal\Tests\mailchimp_campaign\FunctionalCode
public function testGetCampaign() {
$campaign_id = '42694e9e57';
$campaign = mailchimp_get_campaign_data($campaign_id);
$this
->assertTrue(is_object($campaign), 'Tested retrieval of campaign data.');
$this
->assertSame($campaign->id, $campaign_id);
$this
->assertSame($campaign->type, 'regular');
$this
->assertSame($campaign->recipients->list_id, '57afe96172');
$this
->assertSame($campaign->settings->subject_line, 'Test Campaign');
$this
->assertTrue($campaign->tracking->html_clicks);
$this
->assertFalse($campaign->tracking->text_clicks);
}