You are here

public function MailchimpListsTestCase::testAddWebhook in Mailchimp 7.5

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

Tests adding a webhook to a list.

File

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

Class

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

Code

public function testAddWebhook() {
  $list_id = '57afe96172';
  $url = 'http://example.org/web-hook-new';
  $events = array(
    'subscribe' => TRUE,
  );
  $sources = array(
    'user' => TRUE,
    'admin' => TRUE,
    'api' => FALSE,
  );
  $webhook_id = mailchimp_webhook_add($list_id, $url, $events, $sources);
  $this
    ->assertEqual($webhook_id, 'ab24521a00');
}