Skip to content

Commit

Permalink
Build/Test Tools: Only require the WordPress Importer plugin when run…
Browse files Browse the repository at this point in the history
…ning 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
  • Loading branch information
SergeyBiryukov committed Sep 24, 2024
1 parent 60a66de commit 7f4fd30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/phpunit/includes/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 7f4fd30

Please sign in to comment.