wordpress-develop/tests/phpunit/tests/comment
Boone Gorges 578134d4ff Use wp_installing() instead of WP_INSTALLING constant.
The `WP_INSTALLING` constant is a flag that WordPress sets in a number of
places, telling the system that options should be fetched directly from the
database instead of from the cache, that WP should not ping wordpress.org for
updates, that the normal "not installed" checks should be bypassed, and so on.

A constant is generally necessary for this purpose, because the flag is
typically set before the WP bootstrap, meaning that WP functions are not yet
available.  However, it is possible - notably, during `wpmu_create_blog()` -
for the "installing" flag to be set after WP has already loaded. In these
cases, `WP_INSTALLING` would be set for the remainder of the process, since
there's no way to change a constant once it's defined. This, in turn, polluted
later function calls that ought to have been outside the scope of site
creation, particularly the non-caching of option data. The problem was
particularly evident in the case of the automated tests, where `WP_INSTALLING`
was set the first time a site was created, and remained set for the rest of the
suite.

The new `wp_installing()` function allows developers to fetch the current
installation status (when called without any arguments) or to set the
installation status (when called with a boolean `true` or `false`). Use of
the `WP_INSTALLING` constant is still supported; `wp_installing()` will default
to `true` if the constant is defined during the bootstrap.

Props boonebgorges, jeremyfelt.
See #31130.

git-svn-id: https://develop.svn.wordpress.org/trunk@34828 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-05 15:05:26 +00:00
..
checkComment.php Add tests for check_comment(). 2015-05-20 19:08:07 +00:00
commentForm.php In comment_form(), ensure that filtered arguments contain all required default values. 2015-05-19 01:03:39 +00:00
commentsTemplate.php Tests: Introduce WP_UnitTestCase::reset_permalinks(), an attempt to DRY up logic for resetting and restoring default permalinks on setUp() and tearDown(). 2015-10-03 17:14:12 +00:00
dateQuery.php Move PHPUnit tests into a tests/phpunit directory. 2013-08-29 18:39:34 +00:00
getCommentClass.php Bail early when invalid ID is passed to get_comment_class(). 2015-09-23 14:08:47 +00:00
getCommentCount.php Comments: wp_count_comments() can use get_comment_count() internally to makes its DB query, provided that get_comment_count() returns more properties. 2015-08-31 18:50:12 +00:00
getCommentExcerpt.php Comments: add a 'comment_excerpt_length' filter to get_comment_excerpt(). 2015-09-24 21:04:16 +00:00
getCommentLink.php Ensure that comment permalinks reflect pagination. 2015-10-01 05:12:39 +00:00
getCommentsPagesCount.php Force comment pagination on single posts. 2015-09-25 20:39:18 +00:00
getPageOfComment.php Use wp_installing() instead of WP_INSTALLING constant. 2015-10-05 15:05:26 +00:00
metaCache.php Improve lazyloading of comment meta in WP_Query loops. 2015-09-30 01:34:54 +00:00
query.php Improve post field lazyloading for comments. 2015-09-26 16:01:05 +00:00
slashes.php Missed files from [34172]. 2015-09-15 08:08:15 +00:00
template.php Allow get_comments_number() to officially accept $post or $post_id. Adds unit tests. 2014-05-23 17:43:03 +00:00
walker.php Ensure that a has_children parameter is given to Walker::start_el(). 2014-06-24 17:05:56 +00:00
wpCountComments.php In _wp_ajax_delete_comment_response(), read the new 'all' prop returned by get_comment_count() via wp_count_comments() when setting $total. 'all' doesn't include spam in its count. 2015-09-15 01:46:51 +00:00