Opened 4 years ago
Closed 4 years ago
#54822 closed defect (bug) (fixed)
Incorrectly accessing posts fetched by WP_Query in query PHPUnit tests
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.0 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Build/Test Tools | Keywords: | |
| Focuses: | Cc: |
Description
Similarly to #53280, the usage of WP_Query::get_posts() method after the WP_Query object was initialised with arguments passed to it is incorrect in tests/phpunit/tests/query/invalidQueries.php and tests/phpunit/tests/query/taxQuery.php PHPUnit tests, as it triggers just one more SQL query.
For instance: https://core.trac.wordpress.org/browser/trunk/tests/phpunit/tests/query/invalidQueries.php?rev=51568#L94 or https://core.trac.wordpress.org/browser/trunk/tests/phpunit/tests/query/taxQuery.php?rev=52389#L1027
Instead, the posts should be read via WP_Query::posts property.
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
In 52577: