wordpress-develop/tests/phpunit/tests/query
Joe McGill cb54fdb142 Build/Test Tools: Reset main query object after each test.
This resets the main query variable, `$wp_the_query` during the `WP_UnitTestCase_Base::tear_down` method that runs after each PHPUnit test. This ensures any changes to the main query object is reset after each test to avoid cross contamination between tests, similar to how other globals are reset.

Props flixos90, spacedmonkey, joemcgill.
Fixes #58776.


git-svn-id: https://develop.svn.wordpress.org/trunk@56212 602fd350-edb4-49c9-b593-d223f7449a82
2023-07-11 13:31:03 +00:00
..
cacheResults.php Docs: Use correct 6.2.0 @since version in multiple docblocks. 2023-02-15 22:54:41 +00:00
commentCount.php Build/Test Tools: Reduce the use of unnecessary randomness in tests. 2021-12-19 13:42:37 +00:00
commentFeed.php Tests: Use the function get_num_queries across all unit tests. 2023-05-11 10:05:51 +00:00
conditionals.php Tests: Use the factory method instead of the property. 2022-09-06 22:09:49 +00:00
date.php Tests: Replace some occurrences of assertEquals() with assertSame(). 2022-10-07 01:02:07 +00:00
dateQuery.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
fieldsClause.php Coding Standards: Add visibility to properties in tests/phpunit/tests/. 2022-11-29 12:40:08 +00:00
generatePostdata.php Coding Standards: Always use parentheses when instantiating an object. 2022-11-29 15:49:49 +00:00
invalidQueries.php Tests: Avoid duplicate queries in some WP_Query tests. 2022-01-14 17:50:52 +00:00
isTerm.php Build/Test Tools: Reset main query object after each test. 2023-07-11 13:31:03 +00:00
lazyLoadCommentMeta.php Comments: Deprecate wp_queue_comments_for_comment_meta_lazyload function. 2023-05-25 10:29:39 +00:00
lazyLoadTermMeta.php Taxonomy: Always lazily load term meta. 2023-04-21 09:22:04 +00:00
metaQuery.php Coding Standards: Fix WPCS issues in [51367]. 2021-07-07 10:50:43 +00:00
noFoundRows.php Tests: Use the factory method instead of the property. 2022-09-06 22:09:49 +00:00
parseQuery.php Query: Be better at forcing data types for query vars. 2022-08-13 22:29:19 +00:00
postStatus.php Tests: Correct references to set_up() and tear_down() in various DocBlocks. 2022-11-22 21:25:27 +00:00
results.php Coding Standards: Add visibility to methods in tests/phpunit/tests/. 2021-11-04 15:22:47 +00:00
search.php Media: Refactor search by filename within the admin. 2022-10-17 11:17:38 +00:00
searchColumns.php Tests: Use assertSameSets() in WP_Query tests for search_columns argument. 2023-02-07 14:58:08 +00:00
setupPostdata.php Coding Standards: Always use parentheses when instantiating an object. 2022-11-29 15:49:49 +00:00
stickies.php General: Use static on closures whenever $this is not used to avoid memory leaks. 2023-05-17 22:44:21 +00:00
taxQuery.php Tests: Make sure the correct query is tested for term limits in taxonomy queries. 2023-03-04 11:50:26 +00:00
vars.php Docs: Align spelling with American English. 2023-01-10 09:07:01 +00:00
verboseRewriteRules.php Coding Standards: Add visibility to methods in tests/phpunit/tests/. 2021-11-04 15:22:47 +00:00