Make WordPress Core

Changeset 52359


Ignore:
Timestamp:
12/12/2021 03:46:46 PM (3 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/install.php

    r47904 r52359  
    1515
    1616define( 'WP_INSTALLING', true );
     17
     18/*
     19 * Cron tries to make an HTTP request to the site, which always fails,
     20 * because tests are run in CLI mode only.
     21 */
     22define( 'DISABLE_WP_CRON', true );
     23
    1724require_once $config_file_path;
    1825require_once __DIR__ . '/functions.php';
Note: See TracChangeset for help on using the changeset viewer.