Make WordPress Core

Changeset 47496


Ignore:
Timestamp:
03/24/2020 12:18:29 AM (5 years ago)
Author:
azaozz
Message:

Build/Test Tools: Fix PHPUnit bootstrap to install WP from /build when tests are run with npm run test, grunt test, grunt then phpunit, etc.

Fixes #49663.

Location:
trunk/tests/phpunit/includes
Files:
2 edited

Legend:

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

    r47328 r47496  
    9898
    9999if ( '1' !== getenv( 'WP_TESTS_SKIP_INSTALL' ) ) {
    100     system( WP_PHP_BINARY . ' ' . escapeshellarg( __DIR__ . '/install.php' ) . ' ' . escapeshellarg( $config_file_path ) . ' ' . $multisite, $retval );
     100    $core_tests = ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS ) ? 'run_core_tests' : 'no_core_tests';
     101    $ms_tests   = $multisite ? 'run_ms_tests' : 'no_ms_tests';
     102
     103    system( WP_PHP_BINARY . ' ' . escapeshellarg( __DIR__ . '/install.php' ) . ' ' . escapeshellarg( $config_file_path ) . ' ' . $ms_tests . ' ' . $core_tests, $retval );
    101104    if ( 0 !== $retval ) {
    102105        exit( $retval );
  • trunk/tests/phpunit/includes/install.php

    r47198 r47496  
    88
    99$config_file_path = $argv[1];
    10 $multisite        = ! empty( $argv[2] );
     10$multisite        = in_array( 'run_ms_tests', $argv, true );
     11
     12if ( ! defined( 'WP_RUN_CORE_TESTS' ) && in_array( 'run_core_tests', $argv, true ) ) {
     13    define( 'WP_RUN_CORE_TESTS', true );
     14}
    1115
    1216define( 'WP_INSTALLING', true );
Note: See TracChangeset for help on using the changeset viewer.