Always clean install in PHPUnit Tests.
Props bpetty. Fixes #25871. git-svn-id: https://develop.svn.wordpress.org/trunk@26095 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
2ccc101050
commit
6603f4802a
@ -22,17 +22,6 @@ require_once ABSPATH . '/wp-settings.php';
|
||||
require_once ABSPATH . '/wp-admin/includes/upgrade.php';
|
||||
require_once ABSPATH . '/wp-includes/wp-db.php';
|
||||
|
||||
define( 'WP_TESTS_VERSION_FILE', ABSPATH . '.wp-tests-version' );
|
||||
|
||||
$wpdb->suppress_errors();
|
||||
$installed = $wpdb->get_var( "SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'" );
|
||||
$wpdb->suppress_errors( false );
|
||||
|
||||
$hash = get_option( 'db_version' ) . ' ' . (int) $multisite . ' ' . sha1_file( $config_file_path );
|
||||
|
||||
if ( $installed && file_exists( WP_TESTS_VERSION_FILE ) && file_get_contents( WP_TESTS_VERSION_FILE ) == $hash )
|
||||
return;
|
||||
|
||||
$wpdb->query( 'SET storage_engine = INNODB' );
|
||||
$wpdb->select( DB_NAME, $wpdb->dbh );
|
||||
|
||||
@ -63,5 +52,3 @@ if ( $multisite ) {
|
||||
install_network();
|
||||
populate_network( 1, WP_TESTS_DOMAIN, WP_TESTS_EMAIL, $title, '/', $subdomain_install );
|
||||
}
|
||||
|
||||
file_put_contents( WP_TESTS_VERSION_FILE, $hash );
|
||||
|
Loading…
Reference in New Issue
Block a user