Make WordPress Core

Changeset 53 in tests for wp-testlib/utils.php


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.