Build/Test Tools: Disable WP Cron when installing PHPUnit tests.

During the WordPress installation process when running the test suite, an HTTP request was always fired by a cron task and failed, because tests are run in CLI mode only.

To avoid that, the `DISABLE_WP_CRON` constant was previously added to the `bootstrap.php` file. However, the constant is not passed to the `install.php` script. This commit makes a similar change to `install.php`.

Follow-up to [760/tests], [872/tests].

Props Chouby.
Fixes #54612.

git-svn-id: https://develop.svn.wordpress.org/trunk@52359 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2021-12-12 15:46:46 +00:00
parent cdd5e43a04
commit 0a346a22ba

View File

@@ -14,6 +14,13 @@ if ( ! defined( 'WP_RUN_CORE_TESTS' ) && in_array( 'run_core_tests', $argv, true
}
define( 'WP_INSTALLING', true );
/*
* Cron tries to make an HTTP request to the site, which always fails,
* because tests are run in CLI mode only.
*/
define( 'DISABLE_WP_CRON', true );
require_once $config_file_path;
require_once __DIR__ . '/functions.php';