Skip to content

test(subs): match wp_redirect filter signature in invite test#524

Merged
jason10lee merged 2 commits into
mainfrom
fix/nppm-2974-redirect-closure-param
Jul 14, 2026
Merged

test(subs): match wp_redirect filter signature in invite test#524
jason10lee merged 2 commits into
mainfrom
fix/nppm-2974-redirect-closure-param

Conversation

@jason10lee

Copy link
Copy Markdown
Contributor

All Submissions:

  • Have you followed the Newspack Contributing guidelines?
  • Does your code follow the WordPress and VIP Go coding standards?
  • Have you checked there aren't other open PRs for the same change?

Changes proposed in this Pull Request:

Resolves NPPM-2974 (cosmetic follow-up from the #488 / NPPM-2966 review).

The run_invite_request() test helper hooks wp_redirect with a zero-parameter
closure. Give it an explicit $location parameter so it matches the filter
signature and the sibling capture_link_invite_log_events() helper in the same
file. No behavior change — the closure still throws to unwind the handler.

How to test the changes in this Pull Request:

  1. n test-php --filter Test_Group_Subscription_Invite — still green (8 tests).

Other information:

  • Have you added an explanation of what your changes do and why?
  • Have you written new tests for your changes, as applicable? — n/a, test-only signature tweak
  • Have you successfully run tests with your changes locally?

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jason10lee jason10lee requested a review from a team as a code owner July 3, 2026 11:52
Copilot AI review requested due to automatic review settings July 3, 2026 11:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates a PHPUnit test helper in newspack-plugin’s WooCommerce Subscriptions group-subscription invite tests so its wp_redirect filter callback accepts the expected argument, avoiding argument-count failures when the filter is invoked.

Changes:

  • Adjust the run_invite_request() redirect-capture closure to accept the redirect location parameter (matching the approach used by the similar helper in the same test file).

@adekbadek adekbadek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions github-actions Bot added [Status] Approved Pull request has been approved and removed [Status] Needs Review labels Jul 14, 2026
@jason10lee jason10lee merged commit ad1c7a3 into main Jul 14, 2026
10 checks passed
@jason10lee jason10lee deleted the fix/nppm-2974-redirect-closure-param branch July 14, 2026 20:17
@github-actions

Copy link
Copy Markdown

Hey @jason10lee, good job getting this PR merged! 🎉

Now, the needs-changelog label has been added to it.

Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label.

If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label.

Thank you! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Status] Approved Pull request has been approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants