diff --git a/tests/phpunit/tests/import/import.php b/tests/phpunit/tests/import/import.php index 82d7fc6820..24664312c2 100644 --- a/tests/phpunit/tests/import/import.php +++ b/tests/phpunit/tests/import/import.php @@ -14,6 +14,11 @@ class Tests_Import_Import extends WP_Import_UnitTestCase { define( 'WP_LOAD_IMPORTERS', true ); add_filter( 'import_allow_create_users', '__return_true' ); + + if ( ! file_exists( DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php' ) ) { + $this->markTestSkipped( 'WordPress Importer plugin is not installed.' ); + } + require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php'; global $wpdb; diff --git a/tests/phpunit/tests/import/parser.php b/tests/phpunit/tests/import/parser.php index dc3dd79b1f..4487d865a5 100644 --- a/tests/phpunit/tests/import/parser.php +++ b/tests/phpunit/tests/import/parser.php @@ -13,6 +13,10 @@ class Tests_Import_Parser extends WP_Import_UnitTestCase { if ( ! defined( 'WP_LOAD_IMPORTERS' ) ) define( 'WP_LOAD_IMPORTERS', true ); + if ( ! file_exists( DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php' ) ) { + $this->markTestSkipped( 'WordPress Importer plugin is not installed.' ); + } + require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php'; } diff --git a/tests/phpunit/tests/import/postmeta.php b/tests/phpunit/tests/import/postmeta.php index c21011446d..d6d597dd06 100644 --- a/tests/phpunit/tests/import/postmeta.php +++ b/tests/phpunit/tests/import/postmeta.php @@ -13,6 +13,10 @@ class Tests_Import_Postmeta extends WP_Import_UnitTestCase { if ( ! defined( 'WP_LOAD_IMPORTERS' ) ) define( 'WP_LOAD_IMPORTERS', true ); + if ( ! file_exists( DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php' ) ) { + $this->markTestSkipped( 'WordPress Importer plugin is not installed.' ); + } + require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php'; }