Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix validation of array of fields + adjust tests#2656

Closed
felipeelia wants to merge 3 commits into
WordPress:trunkfrom
felipeelia:issue-53177
Closed

Fix validation of array of fields + adjust tests#2656
felipeelia wants to merge 3 commits into
WordPress:trunkfrom
felipeelia:issue-53177

Conversation

@felipeelia

Copy link
Copy Markdown
Member

This PR addresses the adjustments outlined by @peterwilsoncc

Trac ticket: https://core.trac.wordpress.org/ticket/53177


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

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

When reviewing the tests, I noticed a typo in the query include[space] rather than include.

This results in all users been returned each time, instead of just the one admin you are aiming for. That's why you needed to check for user 1 rather than the user ID self::$admin_ids[0]

To force the right check, I'd recommend setting the included user to 1

In the data provider

  • set the email to WP_TESTS_EMAIL
  • set the URL to wp_guess_url()

Other details for the admin user are hard coded within the test suite.

@felipeelia

Copy link
Copy Markdown
Member Author

Good catch @peterwilsoncc, didn't notice the include[space] there. I've addressed all those things in my last commit. Do you mind giving it another look? Thanks!

@peterwilsoncc

Copy link
Copy Markdown
Contributor

Merged in https://core.trac.wordpress.org/changeset/53327, thank you!

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.

2 participants