MailchimpCampaignTest.php in Mailchimp 8
File
modules/mailchimp_campaign/src/Tests/MailchimpCampaignTest.php
View source
<?php
namespace Drupal\Tests\mailchimp_campaign\Functional;
class MailchimpCampaignTest extends MailchimpCampaignTestBase {
public static $modules = [
'mailchimp',
'mailchimp_campaign',
'mailchimp_test',
];
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);
}
}