wordpress-develop/tests/phpunit/tests/user
Sergey Biryukov f0d53f8100 Build/Test Tools: Update PHPUnit Polyfills to version 1.1.0.
[https://github.com/sebastianbergmann/phpunit/blob/9.6/ChangeLog-9.6.md#961---2023-02-03 PHPUnit 9.6.1] deprecated the `assertObjectHasAttribute()` and `assertObjectNotHasAttribute()` methods, leading to deprecation notices in a number of tests.

[https://github.com/sebastianbergmann/phpunit/blob/10.1.3/ChangeLog-10.1.md#1010---2023-04-14 PHPUnit 10.1.0] brought the methods back by popular request, though renamed as `assertObjectHasProperty()` and `assertObjectNotHasProperty()`, to prevent confusion with PHP 8.0 attributes.

This meant that users which cannot (yet) upgrade to PHPUnit 10.1+ would always have deprecation notices for these methods without recourse. So, after much discussion, the new methods have been backported to [https://github.com/sebastianbergmann/phpunit/blob/9.6/ChangeLog-9.6.md#9611---2023-08-19 PHPUnit 9.6.11], leaving just the 10.0.x series with a deprecation notice and no recourse.

What does this mean for WordPress?

WordPress uses the [https://github.com/Yoast/PHPUnit-Polyfills PHPUnit Polyfills] to be able to write tests for the most recent versions of PHPUnit, with the Polyfills taking care of polyfilling any new PHPUnit methods on older PHPUnit versions.

* The PHPUnit Polyfills 1.x series supports PHPUnit 4.x to 9.x.
* The PHPUnit Polyfills 2.x series supports PHPUnit 5.x to 10.x.

WordPress currently runs against PHPUnit 6.x to 9.x with PHPUnit Polyfills 1.x, while the new methods were previously only included in PHPUnit Polyfills 2.0.0+, as they were introduced in PHPUnit 10.x.

Since the `assertObjectHasProperty()` and `assertObjectNotHasProperty()` methods have been backported to PHPUnit 9.x, the PHPUnit Polyfills will now include these methods in the 1.x series as well.

By upgrading to the latest [https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/1.1.0 PHPUnit Polyfills 1.1.0] release, we can get rid of the deprecation notices related to the use of the `assertObjectHasAttribute()` and `assertObjectNotHasAttribute()` methods.

This could have implications for plugins or themes running integration tests with WordPress if they have set their PHPUnit Polyfills dependency to a fixed version or have a too strict version constraint (limiting the PHPUnit Polyfills to the 1.0.x series). The solution for those plugins or themes is to update their version constraints for the PHPUnit Polyfills to allow for the 1.1.x series.

Follow-up to [51559], [51598].

Props jrf, ayeshrajans.
Fixes #59150.

git-svn-id: https://develop.svn.wordpress.org/trunk@56421 602fd350-edb4-49c9-b593-d223f7449a82
2023-08-21 15:53:04 +00:00
..
capabilities.php Tests: Use the data_ prefix for various data provider methods. 2023-03-19 12:03:30 +00:00
countUserPosts.php Tests: Replace some occurrences of assertEquals() with assertSame(). 2022-10-07 01:02:07 +00:00
countUsers.php Tests: Replace some occurrences of assertEquals() with assertSame(). 2022-10-07 01:02:07 +00:00
dateQuery.php Tests: Introduce assertSameSets() and assertSameSetsWithIndex(), and use them where appropriate. 2020-09-04 07:01:00 +00:00
getActiveBlogForUser.php Tests: Rename classes in phpunit/tests/user/ per the naming conventions. 2022-06-11 15:48:31 +00:00
getTheAuthor.php Code Modernization: Correct fallback return value in get_the_author(). 2023-05-14 17:56:26 +00:00
getTheAuthorLink.php Tests: Split the tests from user/author.php into individual test classes. 2023-05-13 13:33:33 +00:00
getTheAuthorMeta.php Code Modernization: Correct fallback return value in get_the_author(). 2023-05-14 17:56:26 +00:00
getTheAuthorPosts.php Tests: Split the tests from user/author.php into individual test classes. 2023-05-13 13:33:33 +00:00
getTheAuthorPostsLink.php Code Modernization: Correct fallback return value in get_the_author(). 2023-05-14 17:56:26 +00:00
getTheModifiedAuthor.php Code Modernization: Correct fallback return value in get_the_author(). 2023-05-14 17:56:26 +00:00
getUserCount.php Tests: Remove skipWithMultisite() and skipWithoutMultisite() from get_user_count() tests. 2022-10-29 15:42:26 +00:00
mapMetaCap.php Users: Fail gracefully when checking mapped capabilities without providing the required object ID. 2022-05-17 18:59:24 +00:00
multisite.php Build/Test Tools: Update PHPUnit Polyfills to version 1.1.0. 2023-08-21 15:53:04 +00:00
passwordHash.php Tests: Move PasswordHash test file to a more appropriate place. 2023-02-13 14:20:30 +00:00
query.php Code Modernization: Deprecate dynamic properties in WP_User_Query magic methods. 2023-08-03 16:25:25 +00:00
queryCache.php Users: Correct the logic for switch_to_blog() in WP_User_Query::generate_cache_key(). 2023-08-10 10:24:29 +00:00
retrievePassword.php Tests: Second pass at merging file-level and class-level DocBlocks in various unit test files. 2023-03-03 14:42:42 +00:00
session.php Code Modernization: Explicitly declare all properties created in set_up() methods of various test classes. 2022-08-27 12:30:08 +00:00
slashes.php Cache API: Validate cache key in WP_Object_Cache methods. 2022-08-03 14:34:58 +00:00
updateUserCaches.php Tests: Use assertInstanceOf() instead of assertTrue() in some tests. 2021-05-18 21:04:31 +00:00
wpAuthenticateSpamCheck.php Tests: Rename classes in phpunit/tests/user/ per the naming conventions. 2022-06-11 15:48:31 +00:00
wpDeleteUser.php Tests: Rename classes in phpunit/tests/user/ per the naming conventions. 2022-06-11 15:48:31 +00:00
wpDropdownUsers.php Tests: Use the factory method instead of the property. 2022-09-06 22:09:49 +00:00
wpGetUsersWithNoRole.php Tests: Rename classes in phpunit/tests/user/ per the naming conventions. 2022-06-11 15:48:31 +00:00
wpListAuthors.php Users: Use a separate variable for the post counts query in wp_list_authors(). 2023-03-01 15:37:06 +00:00
wpListUsers.php Tests: Rename classes in phpunit/tests/user/ per the naming conventions. 2022-06-11 15:48:31 +00:00
wpRegisterPersistedPreferencesMeta.php Users: Correctly pass the context property for persisted preferences. 2022-09-27 15:21:48 +00:00
wpSendUserRequest.php Tests: Merge file-level and class-level DocBlocks in various unit test files. 2023-02-14 16:10:13 +00:00
wpSetCurrentUser.php Tests: Rename classes in phpunit/tests/user/ per the naming conventions. 2022-06-11 15:48:31 +00:00