-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Ensure user switching doesn’t occur for current user. #10905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure user switching doesn’t occur for current user. #10905
Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| /** | ||
| * Data provider for test_should_not_switch_to_same_user_type_equivalency. | ||
| * | ||
| * @return array[] Data provider. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * @return array[] Data provider. | |
| * @return array<string, array{ type_function: string }> Data provider. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@westonruter It's a little mixed but currently it seems common just to add the simplified docs for the data provider to avoid the need to double up docs with the @params in the function above it. For example c4d8047#diff-09a2e7959959d6a08ef07b1849e0178b853f7ef86f7885bbf9be2ed261145b24R4215
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel strongly, but in new tests I've tried to be as explicit about the return types as possible. This makes it easier to understand at a glance what a data provider is expected to return, as opposed to analyzing the pattern in the data being returned. Granted, the data returned here is quite simple.
ff67a3d to
b3dfa06
Compare
Co-authored-by: Weston Ruter <westonruter@gmail.com>
b3dfa06 to
a1836bc
Compare
Ensures the user switching does not occur when attempting to switch to the same user with the user ID cast to a string.
Trac ticket: https://core.trac.wordpress.org/ticket/64628
Use of AI Tools
Nil.
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.