Wordpress/tests/phpunit/tests
Scott Taylor 0baa73f2e4 Apply order to each passed value for orderby in WP_Query:
* Since `orderby` in `WP_Query` can accept space-delimited sets, yet only one `order` value: when multiple values are passed (and `DESC` is the order), the default sort order `ASC` is being applied to all values before the last in the set.
* There is a unit test that sporadically fails since 3.6 in `tests/post/revision` due to multiple posts having the same `post_date` from being added so rapidly
* When ordering revisions in `wp_get_post_revisions()`, order by `post_date ID`
* Change the `order` value in `wp_get_post_revisions()` to `ASC`. This will produce SQL like: `ORDER BY $wpdb->posts.post_date ASC, $wpdb->posts.ID ASC`. Previously, this would have produced SQL like: `ORDER BY $wpdb->posts.post_date DESC`, and with the addition of ` ID`: `ORDER BY $wpdb->posts.post_date ASC, $wpdb->posts.ID DESC`. Clearly, wrong. The original SQL produced: `ORDER BY $wpdb->posts.post_date DESC`. As such, return the reversions in reverse order using `array_reverse()`. Not doing so would break "Preview Changes."
* Add unit tests to assert that all of this works.
* All existing unit tests pass with the change to ordering multiple `orderby`s in `WP_Query`.
* In the future, we should support independent `order` for each `orderby`, see #17065.

Props SergeyBiryukov, wonderboymusic.
Fixes #26042.


git-svn-id: https://develop.svn.wordpress.org/trunk@28541 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 18:18:11 +00:00
..
actions Move PHPUnit tests into a tests/phpunit directory. 2013-08-29 18:39:34 +00:00
admin Avoid stomping of bulk postdata inside the bulk_edit_posts() loop. 2014-04-14 07:47:10 +00:00
ajax Autosave: refactor autosave.js, use heartbeat for transport and move all "Add/Edit Post" related functionality to post.js. See #25272. 2014-01-22 04:55:37 +00:00
attachment Move PHPUnit tests into a tests/phpunit directory. 2013-08-29 18:39:34 +00:00
canonical Move PHPUnit tests into a tests/phpunit directory. 2013-08-29 18:39:34 +00:00
comment Allow user_id to be an array of IDs in WP_Comment_Query. 2014-02-25 16:34:25 +00:00
dependencies When setting WP_TESTS_FORCE_KNOWN_BUGS to true, it is preferable that some forced tests are still skipped when they call classes or functions that do not exist, producing fatal errors. 2013-11-25 22:49:51 +00:00
export When setting WP_TESTS_FORCE_KNOWN_BUGS to true, it is preferable that some forced tests are still skipped when they call classes or functions that do not exist, producing fatal errors. 2013-11-25 22:49:51 +00:00
feed Move PHPUnit tests into a tests/phpunit directory. 2013-08-29 18:39:34 +00:00
filesystem Move PHPUnit tests into a tests/phpunit directory. 2013-08-29 18:39:34 +00:00
formatting Texturize: Massive performance improvements (~600% faster); better handling of nbsp, double, and weird spaces; 136 new unit tests. 2014-03-29 07:15:33 +00:00
functions Eliminate use of extract() in wp_get_archives(). 2014-05-13 04:28:56 +00:00
general Eliminate use of extract() in paginate_links(). Adds unit tests. Moves tests/general/template.php (which only had one method) to tests/general/paginateLinks.php. 2014-05-14 22:28:08 +00:00
http WP_HTTP: Replacing the Fsockopen & Streams Transports with a new Streams transport which fully supports HTTPS communication. 2013-09-04 04:48:21 +00:00
image Add PHP and JS unit tests for custom headers. 2014-03-29 10:05:22 +00:00
import Eliminate some of our last remaining create_function() instances 2014-03-03 16:20:12 +00:00
includes Move PHPUnit tests into a tests/phpunit directory. 2013-08-29 18:39:34 +00:00
meta When using meta_query in a WP_Query, passing NOT EXISTS or '' to compare should not require value to be set. The resulting SQL should then produce the appropriate OR clause for existence of non-existence after passing the query to the $key_only_queries stack internally. 2014-03-24 19:56:54 +00:00
option Transients: Allow a non-expiring transient to be updated with an expiry. 2014-03-25 18:22:49 +00:00
pomo Fix strict notices in Tests_POMO_PO. 2013-12-01 12:47:35 +00:00
post Apply order to each passed value for orderby in WP_Query: 2014-05-22 18:18:11 +00:00
query In WP_Date_Query::get_sql_for_subquery(), don't parse duplicate parameters - only parse one of w and week or month and monthnum. 2014-05-04 23:06:07 +00:00
term Add a conditional unit test for Tax Query - one query that does an IN query for categories with relation for tax_query set to AND. Weird queries are being produced. 2014-04-23 17:40:25 +00:00
theme Fix copy/paste error in [27710]. 2014-04-02 23:46:34 +00:00
user In get_the_author_posts(), if there is no current $post, return 0 and bail. 2014-05-11 00:25:29 +00:00
xmlrpc Fix a multisite test failure by testing an option that can be updated in multisite. 2014-04-10 21:09:33 +00:00
actions.php Introduce doing_filter() and doing_action() to identify hooks in progress. 2014-02-26 18:43:59 +00:00
adminbar.php Move PHPUnit tests into a tests/phpunit directory. 2013-08-29 18:39:34 +00:00
auth.php Move the trim() from wp_set_password() to inside wp_hash_password(). 2013-10-07 13:53:09 +00:00
basic.php Add missing access modifiers to methods in WP_Query. Add magic methods for __get(), __set(), __isset(), __unset(), and __call(). 2014-05-19 06:48:56 +00:00
cache.php Move PHPUnit tests into a tests/phpunit directory. 2013-08-29 18:39:34 +00:00
canonical.php Set the page_comments option to true in Tests_Canonical to properly check canonical redirection for paged comments. By doing so, one assertion tied to #20388 no longer needs to be. 2013-11-11 18:57:11 +00:00
comment.php Move PHPUnit tests into a tests/phpunit directory. 2013-08-29 18:39:34 +00:00
compat.php Move PHPUnit tests into a tests/phpunit directory. 2013-08-29 18:39:34 +00:00
cron.php Pass $args as an array, rather than a splat, to wp_clear_scheduled_hook(). There are comments in the code describing the deprecated argument behavior. 2013-09-11 22:21:43 +00:00
db.php Use ext/mysqli in PHP 5.5 or greater. Expect minor explosions. 2014-02-25 00:39:28 +00:00
dependencies.php Remove tests for code still in development, see #22229. If accidentally run, they produce fatal errors. 2013-10-07 14:17:13 +00:00
file.php Move PHPUnit tests into a tests/phpunit directory. 2013-08-29 18:39:34 +00:00
filters.php Fix the PHP 5.4 Only variables should be passed by reference notices in tests/filters.php. 2013-09-12 04:16:59 +00:00
functions.php Replace the ancient phpfreaks.com RegEx to extract urls to ping with a more robust matcher. URLs with commas and things like & were not being pinged. The new matcher even works for most IDN URLs. Adds unit tests. 2013-09-10 03:17:51 +00:00
iterators.php When setting WP_TESTS_FORCE_KNOWN_BUGS to true, it is preferable that some forced tests are still skipped when they call classes or functions that do not exist, producing fatal errors. 2013-11-25 22:49:51 +00:00
kses.php Unit Tests: Add the ticket number to the new tests. See #26290 2013-11-27 14:47:03 +00:00
l10n.php Revert [25405] and use a file that does exist. see #25282. 2013-09-12 17:47:40 +00:00
link.php Revert the conversion of adjacent post queries to WP_Query. Explanation on the ticket. 2014-03-29 06:02:01 +00:00
mail.php Avoid a notice and clean up setting/unsetting of globals by moving them into setUp() and tearDown() methods in Tests_Mail. 2013-09-12 04:46:49 +00:00
media.php Use Dashicon-style images for mime type icons. Actually moving to Dashicons via the font can be explored later, but has theme/plugin implications and requires too many changes to make it for 3.9. props melchoyce for the icons. fixes #26650. 2014-03-25 21:09:34 +00:00
meta.php Return false from metadata_exists() if the get_$type_metadata filter returns a false value. 2014-03-17 19:39:31 +00:00
ms.php Multisite: Treat 'www' as a special subdomain, reversing 3.9 regression. 2014-05-06 05:31:12 +00:00
post.php Popular tags' edit links should respect the current post type. Adds unit test. 2014-03-25 18:39:26 +00:00
query.php In WP_Query::get_queried_object(), account for pre_get_posts by checking for tag when tag_id isn't present. Tags still need to be rolled up into tax_query. Add a unit test confirming expected query vars during and after pre_get_posts. 2014-03-12 04:07:41 +00:00
rewrite.php Make url_to_postid() work for custom post type URLs. Use get_post_types() and get_taxonomies() instead of directly accessing globals. Adds unit test. 2013-10-02 19:41:19 +00:00
shortcode.php Move PHPUnit tests into a tests/phpunit directory. 2013-08-29 18:39:34 +00:00
taxonomy.php Eliminate the use of extract() in the_taxonomies(). Adds unit test. 2014-05-15 05:24:54 +00:00
term.php Move some cache related tests to the new term/cache.php from [27103]. 2014-02-06 05:19:05 +00:00
theme.php Add unit test to verify all bundled themes have valid text domain declared. 2013-12-12 00:36:27 +00:00
upload.php Restore @ticket reference. Reverts [26093], see #25913. 2013-12-03 03:57:24 +00:00
url.php Don't assume $GLOBALS['post'] is set in tests/url.php. 2013-09-12 05:52:53 +00:00
user.php Reinstate an assertion commented out in [25409]. This test is skipped due to @ticket anyway. see #25282. 2013-09-14 19:17:31 +00:00
widgets.php Move PHPUnit tests into a tests/phpunit directory. 2013-08-29 18:39:34 +00:00