You are here

public function MailchimpListsSubscriptionTest::testUnsubscribe in Mailchimp 8

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

Tests unsubscribing a member from a list.

File

modules/mailchimp_lists/src/Tests/MailchimpListsSubscriptionTest.php, line 89

Class

MailchimpListsSubscriptionTest
Tests list subscription functionality.

Namespace

Drupal\Tests\mailchimp_lists\Functional

Code

public function testUnsubscribe() {
  $list_id = '57afe96172';
  $email = 'test@example.org';
  $unsubscribed = mailchimp_unsubscribe($list_id, $email);
  $this
    ->assertNotEmpty($unsubscribed, 'Tested user unsubscription.');
}