diff --git a/tests/phpunit/includes/bootstrap.php b/tests/phpunit/includes/bootstrap.php index 0390d62312..23faca64e5 100644 --- a/tests/phpunit/includes/bootstrap.php +++ b/tests/phpunit/includes/bootstrap.php @@ -33,6 +33,7 @@ if ( ! is_readable( $config_file_path ) ) { echo "ERROR: wp-tests-config.php is missing! Please use wp-tests-config-sample.php to create a config file.\n"; exit( 1 ); } + require_once $config_file_path; require_once dirname( __FILE__ ) . '/functions.php'; @@ -45,6 +46,11 @@ if ( version_compare( tests_get_phpunit_version(), '8.0', '>=' ) ) { exit( 1 ); } +if ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS && ! is_dir( ABSPATH ) ) { + echo "ERROR: The /build/ directory is missing! Please run `grunt build` prior to running PHPUnit.\n"; + exit( 1 ); +} + tests_reset__SERVER(); define( 'WP_TESTS_TABLE_PREFIX', $table_prefix );