You are here

public function MailchimpListsTestCase::testGetMergevars in Mailchimp 7.4

Same name and namespace in other branches
  1. 7.5 modules/mailchimp_lists/tests/mailchimp_lists.test \MailchimpListsTestCase::testGetMergevars()
  2. 7.3 modules/mailchimp_lists/tests/mailchimp_lists.test \MailchimpListsTestCase::testGetMergevars()

Tests retrieval of mergevars for a set of lists.

File

modules/mailchimp_lists/tests/mailchimp_lists.test, line 93
Test class and methods for the Mailchimp Lists module.

Class

MailchimpListsTestCase
@file Test class and methods for the Mailchimp Lists module.

Code

public function testGetMergevars() {
  $list_ids = array(
    '57afe96172',
  );
  $mergevars = mailchimp_get_mergevars($list_ids);
  $this
    ->assertEqual(count($mergevars[$list_ids[0]]), 3, 'Tested correct mergevar count on retrieval.');
  $this
    ->assertEqual($mergevars[$list_ids[0]][0]->tag, 'EMAIL');
  $this
    ->assertEqual($mergevars[$list_ids[0]][1]->tag, 'FNAME');
  $this
    ->assertEqual($mergevars[$list_ids[0]][2]->tag, 'LNAME');
}