wordpress-develop/tests/phpunit/includes
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
..
factory Code Modernization: Rename parameters that use reserved keywords in phpunit/includes/class-wp-unittest-factory-for-attachment.php. 2022-12-30 02:36:03 +00:00
phpunit6 Build/Test Tools: Alias the Getopt class conditionally, as the class no longer exists in PHPUnit 9.x. 2021-08-07 10:46:54 +00:00
abstract-testcase.php Build/Test Tools: Update PHPUnit Polyfills to version 1.1.0. 2023-08-21 15:53:04 +00:00
bootstrap.php Build/Test Tools: Update PHPUnit Polyfills to version 1.1.0. 2023-08-21 15:53:04 +00:00
class-basic-object.php Tests: Correct magic methods in Basic_Object. 2022-09-07 15:59:16 +00:00
class-basic-subclass.php Build/Test tools: Remove unnecessary PHP functionality tests from the test suite. 2017-12-09 23:08:24 +00:00
class-jsonserializable-object.php Code Modernization: Fix "JsonSerializable_Object::jsonSerialize() should be compatible with JsonSerializable::jsonSerialize(): mixed" error on PHP 8.1. 2021-07-30 14:46:30 +00:00
class-wp-fake-block-type.php Blocks: Introduce WP_Block_Type and WP_Block_Type_Registry classes. 2018-12-13 09:43:29 +00:00
class-wp-rest-test-configurable-controller.php REST API: Don't assume all item schemas have properties. 2020-02-20 16:56:17 +00:00
class-wp-rest-test-search-handler.php REST API: Introduce controller for searching across post types. 2018-12-13 09:37:05 +00:00
class-wp-sitemaps-empty-test-provider.php Docs: Various corrections and improvements relating to types used in inline documentation. 2021-11-18 13:48:43 +00:00
class-wp-sitemaps-large-test-provider.php Docs: Various corrections and improvements relating to types used in inline documentation. 2021-11-18 13:48:43 +00:00
class-wp-sitemaps-test-provider.php Docs: Various corrections and improvements relating to types used in inline documentation. 2021-11-18 13:48:43 +00:00
class-wp-test-stream.php Code Modernization: Rename parameters that use reserved keywords in phpunit/includes/class-wp-test-stream.php. 2022-12-26 11:26:09 +00:00
exceptions.php Docs: Improve documentation for tests/phpunit/includes/testcase-ajax.php. 2020-01-05 15:31:10 +00:00
factory.php Code Modernization: Replace dirname( __FILE__ ) calls with __DIR__ magic constant. 2020-02-06 06:31:22 +00:00
functions.php Tests: Update the terminology used for filter names in tests_add_filter(). 2023-01-02 00:28:02 +00:00
install.php Coding Standards: Remove extra slashes when concatenating ABSPATH with a path. 2022-11-24 22:09:39 +00:00
mock-fs.php Coding Standards: Add public visibility to methods in tests/phpunit/includes/. 2021-11-04 13:15:33 +00:00
mock-image-editor.php Media: apply the wp_editor_set_quality filter not only when loading an image in the editor but also when saving an converted image, after the mime-type of the output image has changed. 2021-08-31 18:57:09 +00:00
mock-invokable.php Docs: Miscellaneous DocBlock corrections. 2021-11-24 23:58:20 +00:00
mock-mailer.php Coding Standards: Add public visibility to methods in tests/phpunit/includes/. 2021-11-04 13:15:33 +00:00
normalize-xml.xsl Sitemaps: Add XML sitemaps functionality to WordPress. 2020-06-17 15:22:49 +00:00
object-cache.php Build/Test: Fix dynamic property deprecation warning in object cache drop-in. 2023-07-07 11:30:15 +00:00
phpunit-adapter-testcase.php Build/Test Tools: Update PHPUnit Polyfills to version 1.1.0. 2023-08-21 15:53:04 +00:00
plural-form-function.php Coding Standards: Use static closures when not using $this. 2021-08-26 12:57:08 +00:00
spy-rest-server.php Code Modernization: Rename parameters that use reserved keywords in phpunit/includes/spy-rest-server.php. 2023-01-03 12:45:29 +00:00
testcase-ajax.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
testcase-canonical.php Tests: Correct references to set_up() and tear_down() in various DocBlocks. 2022-11-22 21:25:27 +00:00
testcase-rest-api.php Coding Standards: Use instanceof keyword instead of the is_a() function. 2023-08-03 12:08:30 +00:00
testcase-rest-controller.php Coding Standards: Always use parentheses when instantiating an object. 2022-11-29 15:49:49 +00:00
testcase-rest-post-type-controller.php Tests: Use more appropriate assertions in various tests. 2021-07-10 11:15:44 +00:00
testcase-xml.php Tests: Replace most instances of assertEquals() in phpunit/includes/ with assertSame(). 2021-02-10 13:23:42 +00:00
testcase-xmlrpc.php Docs: Various docblock improvements and corrections. 2021-11-08 10:47:55 +00:00
testcase.php Build/Test Tools: Change the inheritance order of the abstract test classes. 2021-08-06 00:44:00 +00:00
trac.php Docs: Fix typo in TracTickets::isTracTicketClosed() description. 2022-02-20 10:12:37 +00:00
unregister-blocks-hooks.php Editor: update Wordpress npm packages. 2023-06-27 14:20:18 +00:00
utils.php Code Modernization: Rename parameters that use reserved keywords in phpunit/includes/utils.php. 2023-01-04 14:16:57 +00:00
wp-profiler.php Coding Standards: Fix spacing for incrementors and decrementors in various files. 2022-11-29 21:11:42 +00:00