From f213decc7ec48d8d5dd86cce7e4a4d797875d978 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 2 Mar 2014 10:34:58 +0000 Subject: [PATCH] Skip import tests if WordPress Importer plugin is missing. props mattheu. fixes #27250. git-svn-id: https://develop.svn.wordpress.org/trunk@27349 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/import/import.php | 5 +++++ tests/phpunit/tests/import/parser.php | 4 ++++ tests/phpunit/tests/import/postmeta.php | 4 ++++ 3 files changed, 13 insertions(+) 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'; }