function setUp() {
		parent::setUp();

		if ( ! defined( 'WP_IMPORTING' ) )
			define( 'WP_IMPORTING', true );

		if ( ! defined( 'WP_LOAD_IMPORTERS' ) )
			define( 'WP_LOAD_IMPORTERS', true );

		require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php';
	}
Beispiel #2
0
 function setUp()
 {
     parent::setUp();
     if (!defined('WP_IMPORTING')) {
         define('WP_IMPORTING', true);
     }
     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';
 }
	function setUp() {
		parent::setUp();

		if ( ! defined( 'WP_IMPORTING' ) )
			define( 'WP_IMPORTING', true );

		if ( ! defined( 'WP_LOAD_IMPORTERS' ) )
			define( 'WP_LOAD_IMPORTERS', true );

		add_filter( 'import_allow_create_users', '__return_true' );
		require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php';

		global $wpdb;
		// crude but effective: make sure there's no residual data in the main tables
		foreach ( array('posts', 'postmeta', 'comments', 'terms', 'term_taxonomy', 'term_relationships', 'users', 'usermeta') as $table)
			$wpdb->query("DELETE FROM {$wpdb->$table}");
	}