@@ -694,7 +694,32 @@ public function testGetSubscriberTagsWithInvalidSubscriberID()
694694 }
695695
696696 /**
697- * Test that creating and destroying a webhook works.
697+ * Test that get_webhooks() returns the expected data.
698+ *
699+ * @since 1.0.0
700+ *
701+ * @return void
702+ */
703+ public function testGetWebhooks ()
704+ {
705+ // Create a webhook first.
706+ $ result = $ this ->api ->create_webhook (
707+ 'https://webhook.site/2705fef6-34ef-4252-9c78-d511c540b58d ' ,
708+ 'subscriber.subscriber_activate ' ,
709+ );
710+ $ ruleID = $ result ->rule ->id ;
711+
712+ // List webhooks, confirming the webhook created exists in the list.
713+ $ webhooks = $ this ->api ->get_webhooks ();
714+ $ this ->assertIsArray ($ webhooks );
715+
716+ // Destroy the webhook.
717+ $ result = $ this ->api ->destroy_webhook ($ ruleID );
718+ $ this ->assertEquals ($ result ->success , true );
719+ }
720+
721+ /**
722+ * Test that create_webhook() and destroy_webhook() works.
698723 *
699724 * We do both, so we don't end up with unnecessary webhooks remaining
700725 * on the ConvertKit account when running tests.
@@ -718,7 +743,7 @@ public function testCreateAndDestroyWebhook()
718743 }
719744
720745 /**
721- * Test that creating and destroying a webhook works with an event parameter.
746+ * Test that create_webhook() and destroy_webhook() works with an event parameter.
722747 *
723748 * We do both, so we don't end up with unnecessary webhooks remaining
724749 * on the ConvertKit account when running tests.
@@ -743,7 +768,7 @@ public function testCreateAndDestroyWebhookWithEventParameter()
743768 }
744769
745770 /**
746- * Test that create_webook () throws an InvalidArgumentException when an invalid
771+ * Test that create_webhook () throws an InvalidArgumentException when an invalid
747772 * event is specified.
748773 *
749774 * @since 1.0.0
0 commit comments