You are here

protected function MailchimpCampaignsTestCase::setUp in Mailchimp 7.3

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

Pre-test setup function.

Enables dependencies. Sets the mailchimp_api_key to the test-mode key. Sets test mode to TRUE.

Overrides DrupalWebTestCase::setUp

File

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

Class

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

Code

protected function setUp() {

  // Use a profile that contains required modules:
  $prof = drupal_get_profile();
  $this->profile = $prof;

  // Enable modules required for the test.
  $enabled_modules = array(
    'libraries',
    'mailchimp',
    'entity',
    'entity_token',
    'mailchimp_campaign',
  );
  parent::setUp($enabled_modules);
  variable_set('mailchimp_api_classname', 'MailChimpTest');
  variable_set('mailchimp_api_key', 'MAILCHIMP_TEST_API_KEY');
  variable_set('mailchimp_test_mode', TRUE);

  // Load API object to ensure test constants are defined.
  libraries_load('mailchimp');
  require_once drupal_get_path('module', 'mailchimp') . '/tests/mailchimp_test.inc';
  mailchimp_get_api_object();
}