Skip to content

Tests: Cover wp_registration_url() - #15226

Open
devmuhib009 wants to merge 1 commit into
WordPress:trunkfrom
devmuhib009:tests/65819-cover-wp-registration-url
Open

devmuhib009 wants to merge 1 commit into
WordPress:trunkfrom
devmuhib009:tests/65819-cover-wp-registration-url

Conversation

@devmuhib009

Copy link
Copy Markdown
Member

This PR adds unit test coverage for wp_registration_url():

  • Tests that wp_registration_url() returns the default registration URL (site_url( 'wp-login.php?action=register', 'login' )).
  • Tests that the register_url filter hook receives $register and modifies the return value of wp_registration_url().

Trac ticket: https://core.trac.wordpress.org/ticket/65819
Props devmuhib009.

Add unit tests for wp_registration_url():
- Verify wp_registration_url() returns the default registration URL.
- Verify the 'register_url' filter receives the expected argument and modifies the output.

See #65819.
Props devmuhib009.
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Core Committers: Use this line as a base for the props when committing in SVN:

Props devmuhib.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@huzaifaalmesbah huzaifaalmesbah 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! Clear, focused unit test coverage for wp_registration_url(). Verifies default URL generation and the register_url filter argument handling and override cleanly. All checks pass.

AI Review: Gemini 3.8 Flash

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are identified in the added PHPUnit coverage for wp_registration_url().

No open issues 🎉

What changed in this PR

Adds PHPUnit coverage for wp_registration_url() as part of Trac ticket #65819, without changing production behavior.

Changes:

  • Verifies that the function returns the default registration URL.
  • Checks that the register_url filter receives the expected URL and can override the return value.
File Description
tests/​phpunit/​tests/​general/​wpRegistrationUrl.php Adds tests for the default registration URL and filter behavior.

Review effort: Balanced

@lancewillett lancewillett 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.

The registration URL and its filter arguments/return are already covered in Tests_General_WpLoginScreenUrls, landed in r65056. That class also checks forced HTTPS. Please drop the duplicate class; retain a change only if it covers a distinct missing regression in the existing class. Otherwise this PR can close as already covered.

All proposed cases passed locally in randomized single-site and multisite runs; the concern is duplicate coverage, not a runtime failure.

AI review · gpt-6

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants