From f4fbba188db2f7f38abd16b8a9de4031b34d011b Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Wed, 23 May 2018 17:54:44 +0000 Subject: [PATCH] Build/Test Tools: Roses are red, this fixes stuff. Update the test infrastructure so that third party plugins, themes, and projects that use the core testing framework continue to operate from the `src` directory and do not require a build step. Props mboynes, danielbachhuber, schlessera See #43055 git-svn-id: https://develop.svn.wordpress.org/trunk@43311 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/includes/bootstrap.php | 2 +- wp-tests-config-sample.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/includes/bootstrap.php b/tests/phpunit/includes/bootstrap.php index f924a7dc03..eccf49354f 100644 --- a/tests/phpunit/includes/bootstrap.php +++ b/tests/phpunit/includes/bootstrap.php @@ -32,7 +32,7 @@ if ( ! is_readable( $config_file_path ) ) { require_once $config_file_path; require_once dirname( __FILE__ ) . '/functions.php'; -if ( file_exists( ABSPATH . '_index.php' ) ) { +if ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS && file_exists( ABSPATH . '_index.php' ) ) { // Perhaps add more documentation about having to run `grunt` before running tests after changing code. echo "ERROR: ABSPATH must point to the `build` directory, not the `src` directory. Please update your wp-tests-config.php file.\n"; exit( 1 ); diff --git a/wp-tests-config-sample.php b/wp-tests-config-sample.php index fd1ccd0d61..2f6c515912 100644 --- a/wp-tests-config-sample.php +++ b/wp-tests-config-sample.php @@ -1,7 +1,11 @@