You are here

public function MailChimp_ListsTest::webhookDel in Mailchimp 7.3

See also

Mailchimp_Lists::webhookDel()

File

tests/mailchimp_lists_test.inc, line 284
A virtual MailChimp Lists API implementation for use in testing.

Class

MailChimp_ListsTest

Code

public function webhookDel($id, $url) {
  $lists = $this
    ->loadLists();
  if (isset($lists[$id])) {
    $complete = FALSE;
    foreach ($lists[$id]['webhooks'] as $key => $webhook) {
      if ($webhook['url'] == $url) {
        unset($lists[$id]['webhooks'][$key]);
        $this
          ->writeLists($lists);
        $complete = TRUE;
        continue;
      }
    }
    $response = array(
      'complete' => $complete,
    );
  }
  else {
    $response = array(
      'status' => 'error',
      'code' => 200,
      'name' => 'List_DoesNotExist',
    );
  }
  return $response;
}