Wordpress/tests/phpunit/includes
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
..
bootstrap.php Initialise $_SERVER[ 'REMOTE_ADDR' ] during the test bootstrap so individual tests need not. 2015-09-15 08:04:33 +00:00
exceptions.php Move PHPUnit tests into a tests/phpunit directory. 2013-08-29 18:39:34 +00:00
factory.php Use wp_installing() instead of WP_INSTALLING constant. 2015-10-05 15:05:26 +00:00
functions.php During PHPUnit tests, don't autodetect permalink structure during WP installation. 2015-04-16 23:59:01 +00:00
install.php Set $_SERVER['REQUEST_METHOD'] for unit tests. 2015-06-16 00:03:25 +00:00
mock-fs.php Normalize slashes in WP_Filesystem_MockFS::mkdir() and WP_Filesystem_MockFS::locate_parent_node() to avoid an infinite loop on Windows. 2013-11-18 15:32:47 +00:00
mock-image-editor.php Add tests which ensure the wp_editor_set_quality and jpeg_quality filters only apply if they are added before the corresponding WP_Image_Editor is instantiated. 2014-12-15 21:24:21 +00:00
mock-mailer.php Update PHPMailer to 5.2.10 from 5.2.7. 2015-07-08 17:15:02 +00:00
testcase-ajax.php 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
testcase-canonical.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
testcase-xmlrpc.php Use remove_added_uploads() in tearDown() for XMLRPC tests 2014-11-08 20:17:17 +00:00
testcase.php Use wp_installing() instead of WP_INSTALLING constant. 2015-10-05 15:05:26 +00:00
trac.php Don't use HTTPS in unit tests if OpenSSL isn't loaded. 2014-02-12 20:39:21 +00:00
utils.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
wp-profiler.php Remove PHP4 constructors from Unit Tests 2015-07-08 16:04:11 +00:00