You are here

public function MailchimpListsTestCase::testUpdateMember in Mailchimp 7.3

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

Tests updating a list member.

File

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

Class

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

Code

public function testUpdateMember() {
  $list_id = MAILCHIMP_LISTS_TEST_LIST_A;
  $email = 'user@example.org';
  $subscribed = mailchimp_subscribe($list_id, $email);
  $this
    ->assertTrue($subscribed, 'Tested new user subscription.');
  $updated = mailchimp_update_member($list_id, $email, NULL, 'text');
  $this
    ->assertTrue($updated, 'Tested user update.');
  $member_info = mailchimp_get_memberinfo($list_id, $email);
  $this
    ->assertEqual($member_info['email'], $email, 'Tested updated member email retrieved: ' . $member_info['email']);
}