wordpress-develop/tests/phpunit/tests
Boone Gorges f14dc03ad6 Simplify pagination logic in comments_template().
[34561] "fixed" the problem of newest-first comments showing fewer than
'per_page' comments on the post permalink when the total number of comments
was not divisible by 'per_page'. See #29462. But this fix caused numerous
other problems. First, comment pages reported by `get_page_of_comment()`
(which expects comment pages to be filled oldest-first) were no longer correct.
Second, and more seriously, the new logic caused comments to be shifted
between pages, making their permalinks non-permanent.

The current changeset reverts the changed behavior. In order to preserve the
performance improvements introduced in [34561], an additional query must be
performed when 'default_comments_page=newest' and 'cpage=0' (ie, you're viewing
the post permalink). A nice side effect of this revert is that we no longer
need the hacks required to determine proper comment pagination, introduced in
[34561].

See #8071. See #34073.

git-svn-id: https://develop.svn.wordpress.org/trunk@34729 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-01 03:10:13 +00:00
..
actions Move PHPUnit tests into a tests/phpunit directory. 2013-08-29 18:39:34 +00:00
admin Add unit tests for post_exists(). 2015-09-29 04:02:00 +00:00
ajax Initialise $_SERVER[ 'REMOTE_ADDR' ] during the test bootstrap so individual tests need not. 2015-09-15 08:04:33 +00:00
attachment Fix typo in a comment in slashing tests. 2015-01-07 07:08:47 +00:00
canonical Canonical/Rewrite: sanity check posts that are paged with <!--nextpage-->. Page numbers past the max number of pages are returning the last page of content and causing infinite duplicate content. 2015-09-24 14:03:05 +00:00
category Fix 'exclude_tree' in wp_list_categories(). 2015-09-29 19:11:12 +00:00
comment Simplify pagination logic in comments_template(). 2015-10-01 03:10:13 +00:00
customize Customizer: Defer embedding widget controls to improve DOM performance and initial load time. 2015-09-25 21:01:46 +00:00
date WP_Date_Query date validation should not fail for hour = 0. 2015-01-20 19:12:48 +00:00
db WPDB: Make sure we don't run sanity checks on DB dropins. 2015-09-28 01:16:29 +00:00
dependencies Add a return value to wp_register_script() and wp_register_style() which matches the return value of WP_Dependencies::add(). 2015-05-10 19:56:15 +00:00
feed Tests: Update Tests_Feed_RSS::test_items to expect new comment permalink structure. 2015-09-12 23:30:11 +00:00
filesystem Require dependencies when appropriate in some unit test files. 2015-07-14 03:07:13 +00:00
formatting Revert r34674 due to failures on PHP < 5.4. 2015-09-29 01:00:17 +00:00
functions Allow wp_get_archives() to accept post_type as an arg. 2015-09-29 05:10:10 +00:00
general Tests: Relocate tests for general-template.php to a more logically-placed (and named) file, tests/general/template.php. 2015-09-29 05:51:14 +00:00
http Switch several assertions to assertNotWPError() so more context is provided when the assertion fails. 2015-09-27 22:26:16 +00:00
image Media: In wp_read_image_metadata(), include IPTC Keywords when available in $meta. 2015-09-22 04:18:02 +00:00
import Require dependencies when appropriate in some unit test files. 2015-07-14 03:07:13 +00:00
includes Remove svn:executable from test files. 2015-07-26 09:40:58 +00:00
link Force comment pagination on single posts. 2015-09-25 20:39:18 +00:00
meta Avoid returning duplicate matches when using a meta query in WP_User_Query. 2015-06-09 17:41:35 +00:00
multisite Revert change from true to false in multisite upload test 2015-09-26 20:58:22 +00:00
option Use WP_TESTS_DOMAIN where it should be used in tests in place of hard-coded uses of example.org. 2015-09-24 21:01:10 +00:00
pomo Fix strict notices in Tests_POMO_PO. 2013-12-01 12:47:35 +00:00
post Tests: Add two tests for the current behavior of the 'hierarchical' and 'child_of' arguments in get_pages(). 2015-09-29 21:27:03 +00:00
query Allow setup_postdata() to accept a post ID. 2015-09-12 20:57:06 +00:00
rewrite Rewrite: Redirect attachment URLs when their slug changes. 2015-09-29 04:57:02 +00:00
term Fix db_version juggling during non-multisite tests. 2015-09-30 13:27:09 +00:00
theme Clean up 'post-thumbnail' theme support unit tests. 2014-11-01 04:00:59 +00:00
user Tests: Consolidate author-template tests into a single, more logically-placed file, tests/user/author.php. 2015-09-29 05:37:00 +00:00
xmlrpc XML-RPC: add a unit test for mw.editPost. 2015-09-29 04:27:57 +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 Update links to the user profile editing screen in the admin toolbar when the current logged in user has no role on the current site. Covers single site and Multisite and introduces tests. 2015-09-14 17:09:58 +00:00
auth.php Add 'wp_verify_nonce_failed' action that fires when nonce verification fails. 2015-08-26 00:05:11 +00:00
avatar.php Remove svn:executable from test files. 2015-07-26 09:40:58 +00:00
basic.php Tests: Check that readme.html is recommending an actively supported version of MySQL. 2015-09-08 03:23:29 +00:00
cache.php In PHPUnit test classes, parent::tearDown() should be the last thing done in tearDown() methods. 2015-03-05 13:14:15 +00:00
canonical.php Canonical/Rewrite: sanity check posts that are paged with <!--nextpage-->. Page numbers past the max number of pages are returning the last page of content and causing infinite duplicate content. 2015-09-24 14:03:05 +00:00
category.php In Walker_CategoryDropdown::start_el(), cast values to strings before deciding whether to append 'selected' attribute. 2015-08-21 01:10:34 +00:00
comment.php WP_Comment::get_children() test should be order-agnostic. 2015-09-27 02:00:49 +00:00
compat.php WPDB: When checking that a string can be sent to MySQL, we shouldn't use mb_convert_encoding(), as it behaves differently to MySQL's character encoding conversion. 2015-05-06 02:59:50 +00:00
cron.php In PHPUnit test classes, parent::tearDown() should be the last thing done in tearDown() methods. 2015-03-05 13:14:15 +00:00
db.php WPDB: get_table_from_query() didn't find table names with hyphens in them. 2015-08-24 00:18:49 +00:00
dbdelta.php Remove svn:executable from test files. 2015-07-26 09:40:58 +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 Tests: Clean up the resulting /tmp/foo* files from the tempnam call. 2015-03-31 02:10:52 +00:00
filters.php In remove_all_filters(), only remove callbacks that match the $priority parameter. 2014-12-31 19:06:29 +00:00
functions.php Date/Time: Add unit tests for the_date(). 2015-09-24 03:33:21 +00:00
kses.php Shortcodes: Improve the reliablity of shortcodes inside HTML tags. 2015-07-22 05:14:50 +00:00
l10n.php Remove failing is_textdomain_loaded() test. 2014-11-22 20:36:51 +00:00
link.php Permalinks: Add pretty permalinks for unattached attachments. 2015-09-29 09:41:14 +00:00
mail.php Docs: Put "it's" in its place (again). 2015-09-16 12:45:51 +00:00
media.php Cleanup image size in unit tests 2015-09-29 17:47:24 +00:00
meta.php Update the tests for get_metadata() to reflect the revert in r30701. 2014-12-02 03:43:17 +00:00
multisite.php Initialise $_SERVER[ 'REMOTE_ADDR' ] during the test bootstrap so individual tests need not. 2015-09-15 08:04:33 +00:00
pluggable.php Add function signature tests for the pluggable functions in wp-admin/includes/schema.php and wp-admin/includes/upgrade.php. 2015-09-26 22:03:53 +00:00
post.php In wp_insert_post(), when setting $post_author, use isset() instead of ! empty() to allow 0 to be passed as the value for $post_author. 2015-09-12 18:53:56 +00:00
query.php WP_Query should not ignore an offset of 0. 2015-09-29 19:36:16 +00:00
rewrite.php Rewrite: allow add_rewrite_rule|WP_Rewrite::add_rule() to accept an associative array for the value of $redirect instead of requiring a query string. 2015-09-30 01:10:03 +00:00
shortcode.php Add some more data for Shortcode unit tests. 2015-08-25 21:50:55 +00:00
taxonomy.php Allow taxonomies to be non-public. 2015-09-16 19:04:57 +00:00
term.php Switch several assertions to assertNotWPError() so more context is provided when the assertion fails. 2015-09-27 22:26:16 +00:00
theme.php Themes: Get the correct theme when template and stylesheet were both passed as arguments. 2015-08-30 21:44:38 +00:00
upload.php wp_upload_dir() has a (little-known?) side effect: if you call it, it will attempt to create an uploads directory for the current month. As such, tearDown() and cleanup routines have to be in sync with this behavior when deleting bogus directories used in unit tests. 2014-11-30 19:05:52 +00:00
url.php force_ssl_login() has been functionally identical to force_ssl_admin() since 4.0 (#10267), so its test assertions can be removed as the function has been deprecated in [34700]. The remaining assertions suitably cover force_ssl_admin(). 2015-09-29 21:43:04 +00:00
user.php Add unit test verifying that 60 char user_login is valid. 2015-09-27 15:41:11 +00:00
walker.php Add unit tests for Walker class. 2014-08-01 20:35:25 +00:00
widgets.php Customizer: Defer embedding widget controls to improve DOM performance and initial load time. 2015-09-25 21:01:46 +00:00