Wordpress/tests/phpunit/tests
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
..
actions
admin Tests: Permalink Structures Phase II: DRY up logic for setting permalink structures in test methods. 2015-10-03 20:54:11 +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
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 Use wp_installing() instead of WP_INSTALLING constant. 2015-10-05 15:05:26 +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
db WPDB: Make sure we don't run sanity checks on DB dropins. 2015-09-28 01:16:29 +00:00
dependencies
feed 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
filesystem
formatting Improvements to PCRE benchmarking tests. 2015-10-02 13:50:12 +00:00
functions Allow wp_get_archives() to accept post_type as an arg. 2015-09-29 05:10:10 +00:00
general Use wp_installing() instead of WP_INSTALLING constant. 2015-10-05 15:05:26 +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 More explicit tests for image_get_intermediate_size(). 2015-10-02 14:13:15 +00:00
import
includes Remove svn:executable from test files. 2015-07-26 09:40:58 +00:00
link Tests: Permalink Structures Phase II: DRY up logic for setting permalink structures in test methods. 2015-10-03 20:54:11 +00:00
meta
multisite Revert change from true to false in multisite upload test 2015-09-26 20:58:22 +00:00
option Use wp_installing() instead of WP_INSTALLING constant. 2015-10-05 15:05:26 +00:00
pomo
post Use wp_installing() instead of WP_INSTALLING constant. 2015-10-05 15:05:26 +00:00
query Tests: Permalink Structures Phase II: DRY up logic for setting permalink structures in test methods. 2015-10-03 20:54:11 +00:00
rewrite Tests: Permalink Structures Phase II: DRY up logic for setting permalink structures in test methods. 2015-10-03 20:54:11 +00:00
term Use wp_installing() instead of WP_INSTALLING constant. 2015-10-05 15:05:26 +00:00
theme
user Use wp_installing() instead of WP_INSTALLING constant. 2015-10-05 15:05:26 +00:00
xmlrpc XML-RPC: add a unit test for mw.editPost. 2015-09-29 04:27:57 +00:00
actions.php
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 Unit Tests: in Tests_Cache::test_wp_cache_init(), when wp_using_ext_object_cache(), just check that the global is an instance of WP_Object_Cache. External object cache instances of WP_Object_Cache will contain resources as props that will always have differing internal IDs, so strict comparison won't work. 2015-10-02 05:05:26 +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-submission.php Add missing unit tests from [34799]. 2015-10-03 15:09:57 +00:00
comment.php WP_Comment::get_children() test should be order-agnostic. 2015-09-27 02:00:49 +00:00
compat.php
cron.php
db.php WPDB: Allow null values in the CRUD functions. 2015-10-01 05:36:15 +00:00
dbdelta.php Remove svn:executable from test files. 2015-07-26 09:40:58 +00:00
dependencies.php
file.php
filters.php
functions.php Skip two wp_json_encode() tests when mbstring is unavailable. 2015-10-02 08:54:52 +00:00
kses.php
l10n.php
link.php Tests: Permalink Structures Phase II: DRY up logic for setting permalink structures in test methods. 2015-10-03 20:54:11 +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
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 Tests: Permalink Structures Phase II: DRY up logic for setting permalink structures in test methods. 2015-10-03 20:54:11 +00:00
query.php Tests: Permalink Structures Phase II: DRY up logic for setting permalink structures in test methods. 2015-10-03 20:54:11 +00:00
rewrite.php Tests: Permalink Structures Phase II: DRY up logic for setting permalink structures in test methods. 2015-10-03 20:54:11 +00:00
shortcode.php Pinking shears in shortcode test file. 2015-10-02 13:50:18 +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
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
widgets.php Widgets: Add more tests for registering and unregistering sidebars with 1) no ID, 2) a string ID, 3) a numeric ID. 2015-10-04 05:22:11 +00:00