From cfbb2294f92ade20caa0d0ac2070aee4efc4fbaa Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 22 Oct 2020 00:42:51 +0000 Subject: [PATCH] Build/Test Tools: Only define `WP_PLUGIN_DIR` in when running core tests. This takes into account non-core plugins that rely on `WP_PLUGIN_DIR` being set to the expected plugin's directory in `WP_CONTENT_DIR`, or already have the constant defined. Follow-up to [49236]. Props pierlo. Fixes #51594. git-svn-id: https://develop.svn.wordpress.org/trunk@49269 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/includes/bootstrap.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/includes/bootstrap.php b/tests/phpunit/includes/bootstrap.php index 81910e0701..65c1c370c4 100644 --- a/tests/phpunit/includes/bootstrap.php +++ b/tests/phpunit/includes/bootstrap.php @@ -77,7 +77,10 @@ define( 'DIR_TESTDATA', __DIR__ . '/../data' ); define( 'DIR_TESTROOT', realpath( dirname( __DIR__ ) ) ); define( 'WP_LANG_DIR', realpath( DIR_TESTDATA . '/languages' ) ); -define( 'WP_PLUGIN_DIR', realpath( DIR_TESTDATA . '/plugins' ) ); + +if ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS ) { + define( 'WP_PLUGIN_DIR', realpath( DIR_TESTDATA . '/plugins' ) ); +} if ( ! defined( 'WP_TESTS_FORCE_KNOWN_BUGS' ) ) { define( 'WP_TESTS_FORCE_KNOWN_BUGS', false );