wordpress-develop/tests/phpunit/tests/post
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
..
attachments.php Media: Revert WebP generation. 2022-09-19 22:51:53 +00:00
bodyClass.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
filtering.php Coding Standards: Add visibility to methods in tests/phpunit/tests/. 2021-11-04 15:22:47 +00:00
formats.php Coding Standards: Add visibility to methods in tests/phpunit/tests/. 2021-11-04 15:22:47 +00:00
getBodyClass.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
getLastPostDate.php Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
getLastPostModified.php Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests. 2020-09-02 00:35:36 +00:00
getPageByPath.php Tests: Use the function get_num_queries across all unit tests. 2023-05-11 10:05:51 +00:00
getPageByTitle.php Posts, Post Types: Deprecate get_page_by_title() in favour of WP_Query. 2023-02-03 03:56:10 +00:00
getPageChildren.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
getPages.php Posts, Post Types: Add a new filter for query arguments in get_pages. 2023-05-22 10:01:07 +00:00
getPageTemplateSlug.php Tests: Split the tests from post/template.php into individual test classes. 2023-03-24 17:10:44 +00:00
getPageUri.php Coding Standards: Add visibility to methods in tests/phpunit/tests/. 2021-11-04 15:22:47 +00:00
getPostClass.php Tests: Use the function get_num_queries across all unit tests. 2023-05-11 10:05:51 +00:00
getPostParent.php Tests: Split the tests from post/template.php into individual test classes. 2023-03-24 17:10:44 +00:00
getPosts.php Code is Poetry. 2017-11-30 23:09:33 +00:00
getPostsByAuthorSql.php Tests: Replace assertNotRegExp() with assertDoesNotMatchRegularExpression(). 2021-08-06 21:55:31 +00:00
getPostStatus.php Code Modernization: Replace strftime() and gmstrftime() usage in unit tests. 2021-08-09 19:08:09 +00:00
getPostTypeLabels.php Build/Test Tools: Update PHPUnit Polyfills to version 1.1.0. 2023-08-21 15:53:04 +00:00
getTheContent.php Tests: Replace assertContains() with assertStringContainsString() when used with strings. 2021-07-19 14:00:11 +00:00
getTheExcerpt.php Posts: Prevent an empty excerpt when groups and nested column blocks are present. 2021-07-06 15:31:48 +00:00
isPostPubliclyViewable.php Tests: Correctly use the factory method. 2022-09-06 22:03:10 +00:00
isPostStatusViewable.php Coding Standards: Add visibility to methods in tests/phpunit/tests/. 2021-11-04 15:22:47 +00:00
isPostTypeViewable.php Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:50:26 +00:00
meta.php Coding Standards: Always use parentheses when instantiating an object. 2022-11-29 15:49:49 +00:00
nav-menu.php Tests: Update the test for pre_wp_setup_nav_menu_item filter. 2023-06-22 05:53:05 +00:00
objects.php Coding Standards: Add visibility to methods in tests/phpunit/tests/. 2021-11-04 15:22:47 +00:00
output.php Administration: Replace contracted verb forms for better consistency. 2022-03-22 16:23:32 +00:00
pings.php Tests: Rename some files and classes in phpunit/tests/post/ per the naming conventions. 2020-10-27 16:07:21 +00:00
postClass.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
primePostCaches.php Query: Account for primed post caches without primed post meta/term caches. 2022-11-29 20:27:29 +00:00
query.php Tests: Use the function get_num_queries across all unit tests. 2023-05-11 10:05:51 +00:00
revisions.php Revisions: Remove an unnecessary call to _doing_it_wrong() and corresponding new text string from the implementation of the new wp_save_post_revision_revisions_before_deletion filter. 2023-02-22 20:47:38 +00:00
slashes.php Code Modernization: Remove dynamic properties in Tests_*_Slashes. 2022-06-23 14:24:08 +00:00
thumbnails.php Media: Introduce wp_get_attachment_image_context filter. 2023-05-17 18:29:41 +00:00
truncatePostSlug.php Posts, Post Types: Add test coverage for _truncate_post_slug(). 2023-02-03 04:03:00 +00:00
types.php Coding Standards: Always use parentheses when instantiating an object. 2022-11-29 15:49:49 +00:00
updatePostAuthorCaches.php Query: Some documentation and test improvements for update_post_author_caches(): 2022-06-10 15:15:07 +00:00
updatePostCache.php Build/Test Tools: Update PHPUnit Polyfills to version 1.1.0. 2023-08-21 15:53:04 +00:00
walkerPage.php Tests: Use the factory method instead of the property. 2022-09-06 22:09:49 +00:00
wpAfterInsertPost.php HTTP API: Fix request header inconsistencies. 2023-02-03 13:33:18 +00:00
wpCountAttachments.php Media: Add caching to wp_count_attachments(). 2022-09-20 14:20:57 +00:00
wpDropdownPages.php Tests: Move wp_dropdown_pages() tests to their own file. 2023-03-24 16:12:35 +00:00
wpGetAttachmentLink.php Media: Introduce wp_get_attachment_link_attributes filter. 2023-02-07 14:33:44 +00:00
wpGetPostParentId.php Posts, Post Types: Use global post as the default for wp_get_post_parent_id(). 2021-11-17 03:23:40 +00:00
wpInsertPost.php Tests: Bring some consistency to creating and updating objects in factory classes. 2022-12-28 14:07:16 +00:00
wpLinkPages.php Tests: Split the tests from post/template.php into individual test classes. 2023-03-24 17:10:44 +00:00
wpListPages.php Tests: Add a @ticket reference for wp_list_pages() CSS classes test. 2023-03-24 15:05:29 +00:00
wpPost.php Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes. 2020-11-15 13:59:32 +00:00
wpPostType.php Posts, Post Types/Taxonomies: Add object type specific registration filters. 2022-04-11 05:09:53 +00:00
wpPublishPost.php Tests: Use the factory method instead of the property. 2022-09-06 22:09:49 +00:00
wpTrashPost.php Posts, Post Types: Add a $previous_status parameter to wp_trash_post() related hooks. 2023-06-26 20:55:04 +00:00
wpUniquePostSlug.php Tests: Use the data_ prefix for various data provider methods. 2023-03-19 12:03:30 +00:00
wpUntrashPost.php Posts, Post Types: Add a $previous_status parameter to wp_trash_post() related hooks. 2023-06-26 20:55:04 +00:00