Make WordPress Core


Ignore:
Timestamp:
06/16/2018 02:21:18 PM (7 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Introduce support for a WP_TESTS_CONFIG_FILE_PATH constant to override the test suite config file location.

This can be used in phpunit.xml:

<php>
	<const name="WP_TESTS_CONFIG_FILE_PATH" value="/path/to/wp-tests-config.php" />
</php>

Props clarinetlord

Fixes #39734

File:
1 edited

Legend:

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

    r43315 r43369  
    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 ) );
    18     }
    19 }
    20 $config_file_path .= '/wp-tests-config.php';
     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        }
     22    }
     23    $config_file_path .= '/wp-tests-config.php';
     24}
    2125
    2226/*
Note: See TracChangeset for help on using the changeset viewer.