Make WordPress Core


Ignore:
Timestamp:
11/12/2020 02:41:19 PM (6 years ago)
Author:
ocean90
Message:

I18N: Revert [49236] for now to investigate alternative implementations.

See #39210, #51678, #26511.

File:
1 edited

Legend:

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

    r49535 r49566  
    3838require_once __DIR__ . '/functions.php';
    3939
    40 if ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS && ! is_dir( ABSPATH ) ) {
    41         echo "Error: The /build/ directory is missing! Please run `npm run build` prior to running PHPUnit.\n";
    42         exit( 1 );
    43 }
    44 
    4540$phpunit_version = tests_get_phpunit_version();
    4641
     
    5449}
    5550
    56 $required_extensions = array(
    57         'gd',
    58 );
    59 $missing_extensions  = array();
    60 
    61 foreach ( $required_extensions as $extension ) {
    62         if ( ! extension_loaded( $extension ) ) {
    63                 $missing_extensions[] = $extension;
    64         }
    65 }
    66 
    67 if ( $missing_extensions ) {
    68         printf(
    69                 "Error: The following required PHP extensions are missing from the testing environment: %s.\n",
    70                 implode( ', ', $missing_extensions )
    71         );
    72         echo "Please make sure they are installed and enabled.\n",
     51if ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS && ! is_dir( ABSPATH ) ) {
     52        echo "Error: The /build/ directory is missing! Please run `npm run build` prior to running PHPUnit.\n";
    7353        exit( 1 );
    7454}
     
    8060        'WP_PHP_BINARY',
    8161);
    82 $missing_constants  = array();
    8362
    8463foreach ( $required_constants as $constant ) {
    8564        if ( ! defined( $constant ) ) {
    86                 $missing_constants[] = $constant;
    87         }
    88 }
    89 
    90 if ( $missing_constants ) {
    91         printf(
    92                 "Error: The following required constants are not defined: %s.\n",
    93                 implode( ', ', $missing_constants )
    94         );
    95         echo "Please check out `wp-tests-config-sample.php` for an example.\n",
    96         exit( 1 );
     65                printf(
     66                        "Error: The required %s constant is not defined. Check out `wp-tests-config-sample.php` for an example.\n",
     67                        $constant
     68                );
     69                exit( 1 );
     70        }
    9771}
    9872
     
    10377define( 'DIR_TESTROOT', realpath( dirname( __DIR__ ) ) );
    10478
    105 define( 'WP_LANG_DIR', realpath( DIR_TESTDATA . '/languages' ) );
    106 
    107 if ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS ) {
    108         define( 'WP_PLUGIN_DIR', realpath( DIR_TESTDATA . '/plugins' ) );
    109 }
     79define( 'WP_LANG_DIR', DIR_TESTDATA . '/languages' );
    11080
    11181if ( ! defined( 'WP_TESTS_FORCE_KNOWN_BUGS' ) ) {
     
    171141// Use the Spy REST Server instead of default.
    172142tests_add_filter( 'wp_rest_server_class', '_wp_rest_server_class_filter' );
    173 // Prevent updating translations asynchronously.
    174 tests_add_filter( 'async_update_translation', '__return_false' );
    175 // Disable background updates.
    176 tests_add_filter( 'automatic_updater_disabled', '__return_true' );
    177143
    178144// Preset WordPress options defined in bootstrap file.
Note: See TracChangeset for help on using the changeset viewer.