You are here

protected function MailChimp_ListsTest::defaultLists in Mailchimp 7.3

Creates initial list values.

Return value

array Basic lists.

1 call to MailChimp_ListsTest::defaultLists()
MailChimp_ListsTest::loadLists in tests/mailchimp_lists_test.inc
Loads list values, initializing if necessary.

File

tests/mailchimp_lists_test.inc, line 370
A virtual MailChimp Lists API implementation for use in testing.

Class

MailChimp_ListsTest

Code

protected function defaultLists() {
  $default_mergevars = array(
    array(
      'name' => 'Email',
      'order' => 0,
      'tag' => 'EMAIL',
      'req' => TRUE,
      'web_id' => 'test',
      'field_type' => 'text',
      'size' => 40,
      'default' => '',
      'public' => TRUE,
    ),
    array(
      'name' => 'First Name',
      'order' => 1,
      'tag' => 'FIRSTNAME',
      'req' => FALSE,
      'web_id' => 'test',
      'field_type' => 'text',
      'size' => 40,
      'default' => '',
      'public' => TRUE,
    ),
    array(
      'name' => 'Last Name',
      'order' => 2,
      'tag' => 'LASTNAME',
      'req' => FALSE,
      'web_id' => 'test',
      'field_type' => 'text',
      'size' => 40,
      'default' => '',
      'public' => TRUE,
    ),
  );
  $default_segments = array(
    array(
      'id' => MAILCHIMP_LISTS_TEST_SEGMENT_A,
      'name' => 'Test Segment A',
    ),
    array(
      'id' => MAILCHIMP_LISTS_TEST_SEGMENT_B,
      'name' => 'Test Segment B',
    ),
    array(
      'id' => MAILCHIMP_LISTS_TEST_SEGMENT_C,
      'name' => 'Test Segment C',
    ),
  );
  $default_webhooks = array(
    array(
      'url' => 'http://example.org/web-hook-subscribe',
      'actions' => array(
        'subscribe' => TRUE,
      ),
      'sources' => array(
        'user' => TRUE,
        'admin' => TRUE,
        'api' => TRUE,
      ),
    ),
    array(
      'url' => 'http://example.org/web-hook-unsubscribe',
      'actions' => array(
        'unsubscribe' => TRUE,
      ),
      'sources' => array(
        'user' => TRUE,
        'admin' => TRUE,
        'api' => TRUE,
      ),
    ),
  );
  $lists = array(
    MAILCHIMP_LISTS_TEST_LIST_A => array(
      'name' => 'Test List A',
      'data' => array(),
      'merge_vars' => $default_mergevars,
      'segments' => $default_segments,
      'webhooks' => $default_webhooks,
      'stats' => array(
        'group_count' => 0,
      ),
    ),
    MAILCHIMP_LISTS_TEST_LIST_B => array(
      'name' => 'Test List B',
      'data' => array(),
      'merge_vars' => $default_mergevars,
      'segments' => $default_segments,
      'webhooks' => $default_webhooks,
      'stats' => array(
        'group_count' => 0,
      ),
    ),
    MAILCHIMP_LISTS_TEST_LIST_C => array(
      'name' => 'Test List C',
      'data' => array(),
      'merge_vars' => $default_mergevars,
      'segments' => $default_segments,
      'webhooks' => $default_webhooks,
      'stats' => array(
        'group_count' => 0,
      ),
    ),
  );
  return $lists;
}