You are here

public function MailchimpListsTestCase::testGetWebhook in Mailchimp 7.3

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

Tests retrieval of webhooks for a list.

File

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

Class

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

Code

public function testGetWebhook() {
  $list_id = MAILCHIMP_LISTS_TEST_LIST_A;
  $webhooks = mailchimp_webhook_get($list_id);
  $this
    ->assertFalse(empty($webhooks), 'Tested webhook returned.');
  if (is_array($webhooks)) {
    foreach ($webhooks as $webhook) {
      $this
        ->assertTrue(isset($webhook['url']), 'Tested valid webhook.');
    }
  }
}