Make WordPress Core

Ticket #49663: 49663.1.diff

File 49663.1.diff, 1.3 KB (added by azaozz, 5 years ago)
  • tests/phpunit/includes/bootstrap.php

     
    9797}
    9898
    9999if ( '1' !== getenv( 'WP_TESTS_SKIP_INSTALL' ) ) {
     100        // Need to pass constants and vars as PHP is invoked from cli in a child process.
     101        // Ideally `putenv()` should be used here (it was meant for this). If Safe Mode is on, all would need `PHP_` prefix.
     102        if ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS ) {
     103                putenv( 'PHP_WP_RUN_CORE_TESTS=TRUE' );
     104        }
     105
    100106        system( WP_PHP_BINARY . ' ' . escapeshellarg( __DIR__ . '/install.php' ) . ' ' . escapeshellarg( $config_file_path ) . ' ' . $multisite, $retval );
    101107        if ( 0 !== $retval ) {
    102108                exit( $retval );
  • tests/phpunit/includes/install.php

     
    99$config_file_path = $argv[1];
    1010$multisite        = ! empty( $argv[2] );
    1111
     12if ( ! defined( 'WP_RUN_CORE_TESTS' ) && getenv( 'PHP_WP_RUN_CORE_TESTS' ) === 'TRUE' ) {
     13        define( 'WP_RUN_CORE_TESTS', true );
     14}
     15
    1216define( 'WP_INSTALLING', true );
    1317require_once $config_file_path;
    1418require_once __DIR__ . '/functions.php';