You are here

public function MailchimpListsTest::testAddOrUpdateMember in Mailchimp 8

Tests library functionality for adding or updating an existing list member.

File

lib/mailchimp-api-php/tests/MailchimpListsTest.php, line 190

Class

MailchimpListsTest
Mailchimp Lists test library.

Namespace

Mailchimp\Tests

Code

public function testAddOrUpdateMember() {
  $list_id = '57afe96172';
  $email = 'test@example.com';
  $mc = new MailchimpLists();
  $mc
    ->addOrUpdateMember($list_id, $email);
  $this
    ->assertEquals('PUT', $mc
    ->getClient()->method);
  $this
    ->assertEquals($mc
    ->getEndpoint() . '/lists/' . $list_id . '/members/' . md5($email), $mc
    ->getClient()->uri);
}