Make WordPress Core

Ticket #25871: ticket-25871-reinstall-tests.patch

File ticket-25871-reinstall-tests.patch, 1.1 KB (added by bpetty, 11 years ago)
  • tests/phpunit/includes/install.php

    diff --git tests/phpunit/includes/install.php tests/phpunit/includes/install.php
    index 63de9d2..b9480bc 100644
    require_once ABSPATH . '/wp-settings.php'; 
    2222require_once ABSPATH . '/wp-admin/includes/upgrade.php';
    2323require_once ABSPATH . '/wp-includes/wp-db.php';
    2424
    25 define( 'WP_TESTS_VERSION_FILE', ABSPATH . '.wp-tests-version' );
    26 
    27 $wpdb->suppress_errors();
    28 $installed = $wpdb->get_var( "SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'" );
    29 $wpdb->suppress_errors( false );
    30 
    31 $hash = get_option( 'db_version' ) . ' ' . (int) $multisite . ' ' . sha1_file( $config_file_path );
    32 
    33 if ( $installed && file_exists( WP_TESTS_VERSION_FILE ) && file_get_contents( WP_TESTS_VERSION_FILE ) == $hash )
    34         return;
    35 
    3625$wpdb->query( 'SET storage_engine = INNODB' );
    3726$wpdb->select( DB_NAME, $wpdb->dbh );
    3827
    if ( $multisite ) { 
    6352        install_network();
    6453        populate_network( 1, WP_TESTS_DOMAIN, WP_TESTS_EMAIL, $title, '/', $subdomain_install );
    6554}
    66 
    67 file_put_contents( WP_TESTS_VERSION_FILE, $hash );