You are here

public function MailchimpListsTest::testMultiListRetrieval in Mailchimp 8

Same name and namespace in other branches
  1. 2.x modules/mailchimp_lists/tests/src/Functional/MailchimpListsTest.php \Drupal\Tests\mailchimp_lists\Functional\MailchimpListsTest::testMultiListRetrieval()

Tests retrieval of a specific set of lists.

File

modules/mailchimp_lists/src/Tests/MailchimpListsTest.php, line 34

Class

MailchimpListsTest
Tests core lists functionality.

Namespace

Drupal\Tests\mailchimp_lists\Functional

Code

public function testMultiListRetrieval() {
  $list_ids = [
    '57afe96172',
    'f4b7b26b2e',
  ];
  $lists = mailchimp_get_lists($list_ids);
  $this
    ->assertEqual(count($lists), 2, 'Tested correct list count on retrieval.');
  $this
    ->assertEqual($lists[$list_ids[0]]->id, $list_ids[0]);
  $this
    ->assertEqual($lists[$list_ids[0]]->name, 'Test List One');
  $this
    ->assertEqual($lists[$list_ids[1]]->id, $list_ids[1]);
  $this
    ->assertEqual($lists[$list_ids[1]]->name, 'Test List Two');
}