public function MailchimpListsWebhookTest::testAddWebhook in Mailchimp 8
Same name and namespace in other branches
- 2.x modules/mailchimp_lists/tests/src/Functional/MailchimpListsWebhookTest.php \Drupal\Tests\mailchimp_lists\Functional\MailchimpListsWebhookTest::testAddWebhook()
Tests adding a webhook to a list.
File
- modules/
mailchimp_lists/ src/ Tests/ MailchimpListsWebhookTest.php, line 39
Class
- MailchimpListsWebhookTest
- Tests list webhook functionality.
Namespace
Drupal\Tests\mailchimp_lists\FunctionalCode
public function testAddWebhook() {
$list_id = '57afe96172';
$url = 'http://example.org/web-hook-new';
$events = [
'subscribe' => TRUE,
];
$sources = [
'user' => TRUE,
'admin' => TRUE,
'api' => FALSE,
];
$webhook_id = mailchimp_webhook_add($list_id, $url, $events, $sources);
$this
->assertEqual($webhook_id, 'ab24521a00');
}