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 );