wordpress-develop/tests/phpunit/tests/post
Gary Pendergast 61abf68e6d Hooks: Add the new class WP_Hook, and modify hook handling to make use of it.
Filters and actions have been the basis of WordPress' plugin functionality since time immemorial, they've always been a reliable method for acting upon the current state of WordPress, and will continue to be so.

Over the years, however, edge cases have cropped up. Particularly when it comes to recursively executing hooks, or a hook adding and removing itself, the existing implementation struggled to keep up with more complex use cases.

And so, we introduce `WP_Hook`. By changing `$wp_filter` from an array of arrays, to an array of objects, we reduce the complexity of the hook handling code, as the processing code (see `::apply_filters()`) only needs to be aware of itself, rather than the state of all hooks. At the same time, we're able te handle more complex use cases, as the object can more easily keep track of its own state than an array ever could.

Props jbrinley for the original architecture and design of this patch.
Props SergeyBiryukov, cheeserolls, Denis-de-Bernardy, leewillis77, wonderboymusic, nacin, jorbin, DrewAPicture, ocean90, dougwollison, khag7, pento, noplanman and aaroncampbell for their testing, suggestions, contributions, patch maintenance, cajoling and patience as we got through this.
Fixes #17817.



git-svn-id: https://develop.svn.wordpress.org/trunk@38571 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-08 03:54:13 +00:00
..
attachments.php Remove (or at least reduce) the need to reset common $_SERVER variables before assertions or between tests, by introducing a method which automatically resets them during test setup. 2016-02-26 02:08:47 +00:00
filtering.php Unit Tests: after [35225], make factory a method/getter on WP_UnitTestCase and add magic methods for BC for every plugin that is extending WP_UnitTestCase and accessing the $factory instance prop. 2015-10-17 18:02:16 +00:00
formats.php Unit Tests: after [35225], make factory a method/getter on WP_UnitTestCase and add magic methods for BC for every plugin that is extending WP_UnitTestCase and accessing the $factory instance prop. 2015-10-17 18:02:16 +00:00
getBodyClass.php Themes: Revert [36112] 2016-04-19 21:23:20 +00:00
getPageByPath.php In get_page_by_path(), values fetched from cache should obey $output param. 2016-05-22 16:18:22 +00:00
getPageChildren.php Unit tests for get_page_children(). 2015-05-05 19:36:46 +00:00
getPages.php Unit Tests: better fixtures for Tests_AdminBar. Don't force-delete some posts: some filter callbacks are no-ops on Multisite if the post is vanquished. 2015-10-17 20:48:33 +00:00
getPageUri.php Permalinks: In get_page_uri(), don't prepend a parent page slug if it's empty. 2016-07-23 10:04:20 +00:00
getPostClass.php Site Icon: Get site icon ID only when needed. 2015-10-20 18:22:41 +00:00
getPosts.php Don't specify an offset default in get_posts(). 2015-10-28 18:17:27 +00:00
getPostsByAuthorSql.php Tests: Prevent role capability pollution in Tests_Post_GetPostsByAuthorSql::test_user_has_access_only_to_private_posts_for_certain_post_types(). 2015-12-21 07:15:33 +00:00
isPostTypeViewable.php Allow is_post_type_viewable() to accept a post type name. 2016-01-26 02:36:32 +00:00
listPages.php Menus: Add white space option to wp_nav_menu() and wp_list_pages(). 2016-09-06 09:05:45 +00:00
meta.php Unit Tests: WP_UnitTest_Generator_Sequence needs a static incrementer - otherwise, it assumes every test class is a reset, which it no longer is (it is now static). 2015-10-17 19:24:20 +00:00
nav-menu.php Menus: Add white space option to wp_nav_menu() and wp_list_pages(). 2016-09-06 09:05:45 +00:00
objects.php Unit Tests: after [35225], make factory a method/getter on WP_UnitTestCase and add magic methods for BC for every plugin that is extending WP_UnitTestCase and accessing the $factory instance prop. 2015-10-17 18:02:16 +00:00
output.php Posts: Correctly pass $post to post_password_required() in get_the_excerpt(). 2016-01-16 10:13:27 +00:00
query.php Query: set_found_posts() must run immediately after main query. 2016-06-16 02:00:02 +00:00
revisions.php Unit Tests: 2016-08-27 08:35:16 +00:00
slashes.php Unit Tests: WP_UnitTest_Generator_Sequence needs a static incrementer - otherwise, it assumes every test class is a reset, which it no longer is (it is now static). 2015-10-17 19:24:20 +00:00
template.php Menus: Add white space option to wp_nav_menu() and wp_list_pages(). 2016-09-06 09:05:45 +00:00
thumbnails.php Post Thumbnails: Prevent post thumbnail previews from spilling into other images. 2016-08-29 12:24:09 +00:00
types.php Hooks: Add the new class WP_Hook, and modify hook handling to make use of it. 2016-09-08 03:54:13 +00:00
wpInsertPost.php Use __trashed suffix rather than -%trashed% for trashed post slugs. 2016-04-07 19:21:02 +00:00
wpPost.php Unit Tests: 2016-08-27 08:35:16 +00:00
wpPostType.php Posts: Introduce WP_Post_Type and use it in register_post_type() and unregister_post_type(). 2016-06-28 16:40:33 +00:00
wpUniquePostSlug.php Tests: Use factory method to generate fixtures for wp_unique_post_slug() tests. 2016-05-17 01:48:58 +00:00