Make WordPress Core


Ignore:
Timestamp:
11/11/2013 10:14:24 PM (11 years ago)
Author:
wonderboymusic
Message:

Always clean install in PHPUnit Tests.

Props bpetty.
Fixes #25871.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/install.php

    r25002 r26095  
    2222require_once ABSPATH . '/wp-admin/includes/upgrade.php';
    2323require_once ABSPATH . '/wp-includes/wp-db.php';
    24 
    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;
    3524
    3625$wpdb->query( 'SET storage_engine = INNODB' );
     
    6453    populate_network( 1, WP_TESTS_DOMAIN, WP_TESTS_EMAIL, $title, '/', $subdomain_install );
    6554}
    66 
    67 file_put_contents( WP_TESTS_VERSION_FILE, $hash );
Note: See TracChangeset for help on using the changeset viewer.