You are here

public function MailchimpListsTest::testGetMergevars in Mailchimp 2.x

Same name and namespace in other branches
  1. 8 modules/mailchimp_lists/src/Tests/MailchimpListsTest.php \Drupal\Tests\mailchimp_lists\Functional\MailchimpListsTest::testGetMergevars()

Tests retrieval of mergevars for a set of lists.

File

modules/mailchimp_lists/tests/src/Functional/MailchimpListsTest.php, line 54

Class

MailchimpListsTest
Tests core lists functionality.

Namespace

Drupal\Tests\mailchimp_lists\Functional

Code

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