Changeset 53 in tests
- Timestamp:
- 10/10/2007 05:39:09 PM (17 years ago)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-test.php
r39 r53 49 49 define('WP_INSTALLING', 1); 50 50 require_once(ABSPATH.'wp-settings.php'); 51 52 drop_tables(); 53 51 54 if (TEST_MU) 52 55 require_once(ABSPATH.'wp-admin/upgrade-functions.php'); … … 80 83 81 84 // 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}"); 85 drop_tables(); 86 86 87 87 ?> -
wp-testlib/utils.php
r35 r53 235 235 } 236 236 237 /** 238 * Use to create objects by yourself 239 */ 240 class MockClass {}; 241 242 /** 243 * Drops all tables from the WordPress database 244 */ 245 function 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 } 237 251 ?>
Note: See TracChangeset
for help on using the changeset viewer.