Skip to content

Commit

Permalink
Additional docs
Browse files Browse the repository at this point in the history
  • Loading branch information
brianhogg committed Nov 16, 2023
1 parent 0266fab commit 0ca4aed
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions includes/models/class-llms-rest-webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ public function enqueue() {
*
* Helps avoid duplication of data being sent for topics that have more than one hook defined.
*
* @since [version] Verify the processed flag with all arguments of `$args`.
*
* @param array $args Numeric array of arguments from the originating hook.
* @return bool
*/
Expand Down Expand Up @@ -348,6 +350,7 @@ protected function is_valid_user_action( $user_id ) {
* @since 1.0.0-beta.1
* @since 1.0.0-beta.17 Mark this hook's first argument as processed to ensure it doesn't get processed again within the current request.
* And don't rely anymore on the webhook's `pending_delivery` property to achieve the same goal.
* @since [version] Updated the processed flag to use all arguments of `$args`.
*
* @param mixed ...$args Arguments from the hook.
* @return int|false Timestamp of the scheduled event when the webhook is successfully scheduled.
Expand Down
12 changes: 10 additions & 2 deletions tests/unit-tests/class-llms-rest-test-webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,14 @@ public function test_scheduling_enrollment_created() {

}


/**
* Test scheduling a webhook via multiple hooks, ensuring only one is scheduled for delivery.
*
* @since [version]
*
* @return void
*/
public function test_multiple_hooks_for_single_webhook_only_schedules_once() {

$webhook = LLMS_REST_API()->webhooks()->create( array(
Expand All @@ -780,9 +788,9 @@ public function test_multiple_hooks_for_single_webhook_only_schedules_once() {
}

/**
* Test scheduling enrollment.created via a membership enrollment with multiple auto enroll courses
* Test scheduling enrollment.created via a membership enrollment with multiple auto enroll courses.
*
* @since Unknown
* @since [version]
*
* @return void
*/
Expand Down

0 comments on commit 0ca4aed

Please sign in to comment.