Skip to content

DO NOT MERGE: wp_list_pluck() object regression tests - before and after r57698#6180

Draft
hellofromtonya wants to merge 1 commit intoWordPress:trunkfrom
hellofromtonya:test/before_after_r57698
Draft

DO NOT MERGE: wp_list_pluck() object regression tests - before and after r57698#6180
hellofromtonya wants to merge 1 commit intoWordPress:trunkfrom
hellofromtonya:test/before_after_r57698

Conversation

@hellofromtonya
Copy link
Contributor

DO NOT REVIEW OR COMMIT THIS PR.

Purpose: to better understand and demonstrate how wp_list_pluck() used to and now should handle different object scenarios, such as:

  • Class with both a __get() and __isset().
  • Class with a __get() but no __isset().
  • A __isset() that does not handle null.
  • Dynamic properties.
  • "compat_fields" (compatible but no intended for public) properties.

The original code before r57698 is run via a global $GLOBALS['before_r57698'].

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


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.

@github-actions
Copy link

Test using WordPress Playground

The 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

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

1. Restores the original code to run using a temporary $GLOBAL['before_r57698'].
2. Adds regression tests for before and after r57698 for the following scenarios:

* Class with __get() and __isset().
* Class with __get() but not __isset().
* Dynamic property on each of the class types above.
* A field within an allow list property accessible only through magic method(s).
@hellofromtonya hellofromtonya force-pushed the test/before_after_r57698 branch from ea95d99 to a174e29 Compare February 26, 2024 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant