You are here

public function MailchimpListsTestCase::testIsSubscribed in Mailchimp 7.3

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

Tests the status of a member's subscription to a list.

File

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

Class

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

Code

public function testIsSubscribed() {
  $list_id = MAILCHIMP_LISTS_TEST_LIST_A;
  $email = 'user@example.org';
  $subscribed = mailchimp_subscribe($list_id, $email);
  $this
    ->assertTrue($subscribed, 'Tested new user subscription.');
  $subscribed = mailchimp_is_subscribed($list_id, $email);
  $this
    ->assertTrue($subscribed, 'Tested user is subscribed to list.');
}