Make WordPress Core

Ticket #39734: 39734.patch

File 39734.patch, 1.4 KB (added by johnbillion, 6 years ago)
  • tests/phpunit/includes/bootstrap.php

    diff --git tests/phpunit/includes/bootstrap.php tests/phpunit/includes/bootstrap.php
    index 3ea8eb6636..0d3bd4be96 100644
    if ( class_exists( 'PHPUnit\Runner\Version' ) ) { 
    1010        require_once dirname( __FILE__ ) . '/phpunit6-compat.php';
    1111}
    1212
    13 $config_file_path = dirname( dirname( __FILE__ ) );
    14 if ( ! file_exists( $config_file_path . '/wp-tests-config.php' ) ) {
    15         // Support the config file from the root of the develop repository.
    16         if ( basename( $config_file_path ) === 'phpunit' && basename( dirname( $config_file_path ) ) === 'tests' ) {
    17                 $config_file_path = dirname( dirname( $config_file_path ) );
     13if ( defined( 'WP_TESTS_CONFIG_FILE_PATH' ) ) {
     14        $config_file_path = WP_TESTS_CONFIG_FILE_PATH;
     15} else {
     16        $config_file_path = dirname( dirname( __FILE__ ) );
     17        if ( ! file_exists( $config_file_path . '/wp-tests-config.php' ) ) {
     18                // Support the config file from the root of the develop repository.
     19                if ( basename( $config_file_path ) === 'phpunit' && basename( dirname( $config_file_path ) ) === 'tests' ) {
     20                        $config_file_path = dirname( dirname( $config_file_path ) );
     21                }
    1822        }
     23        $config_file_path .= '/wp-tests-config.php';
    1924}
    20 $config_file_path .= '/wp-tests-config.php';
    2125
    2226/*
    2327 * Globalize some WordPress variables, because PHPUnit loads this file inside a function