Make WordPress Core

Changeset 53 in tests


Ignore:
Timestamp:
10/10/2007 05:39:09 PM (17 years ago)
Author:
nbachiyski
Message:

DROP the tables before install also to prevent leftover tables to do harm

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-test.php

    r39 r53  
    4949define('WP_INSTALLING', 1);
    5050require_once(ABSPATH.'wp-settings.php');
     51
     52drop_tables();
     53
    5154if (TEST_MU)
    5255    require_once(ABSPATH.'wp-admin/upgrade-functions.php');
     
    8083
    8184// clean up the database
    82 global $wpdb;
    83 $tables = $wpdb->get_col('SHOW TABLES;');
    84 foreach ($tables as $table)
    85     $wpdb->query("DROP TABLE IF EXISTS {$table}");
     85drop_tables();
    8686
    8787?>
  • wp-testlib/utils.php

    r35 r53  
    235235}
    236236
     237/**
     238 * Use to create objects by yourself
     239 */
     240class MockClass {};
     241
     242/**
     243 * Drops all tables from the WordPress database
     244 */
     245function drop_tables() {
     246    global $wpdb;
     247    $tables = $wpdb->get_col('SHOW TABLES;');
     248    foreach ($tables as $table)
     249        $wpdb->query("DROP TABLE IF EXISTS {$table}");
     250}
    237251?>
Note: See TracChangeset for help on using the changeset viewer.