From 7f4fd30dffdfe8d7d817c2cdb4ab98408f1c0add Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 24 Sep 2024 19:15:33 +0000 Subject: [PATCH] Build/Test Tools: Only require the WordPress Importer plugin when running core tests. This allows other users of the WordPress unit test suite framework to run their own unit tests without needing the WordPress Importer plugin, which should only be a requirement if running core tests. Follow-up to [59085]. Props bjorsch. Fixes #62106. git-svn-id: https://develop.svn.wordpress.org/trunk@59086 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/includes/bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/includes/bootstrap.php b/tests/phpunit/includes/bootstrap.php index 9db419f18a379..4e369c1f45363 100644 --- a/tests/phpunit/includes/bootstrap.php +++ b/tests/phpunit/includes/bootstrap.php @@ -216,7 +216,7 @@ define( 'DIR_TESTROOT', realpath( dirname( __DIR__ ) ) ); define( 'IMPORTER_PLUGIN_FOR_TESTS', DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php' ); -if ( ! file_exists( IMPORTER_PLUGIN_FOR_TESTS ) ) { +if ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS && ! file_exists( IMPORTER_PLUGIN_FOR_TESTS ) ) { echo 'The test suite requires the WordPress Importer plugin to be available in the `/data/plugins/` directory.' . ' See: https://make.wordpress.org/core/handbook/contribute/git/#unit-tests' . PHP_EOL, exit( 1 );