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
This commit is contained in:
Sergey Biryukov 2014-03-02 10:34:58 +00:00
parent 8ac662c73b
commit f213decc7e
3 changed files with 13 additions and 0 deletions

View File

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

View File

@ -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';
}

View File

@ -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';
}