You are here

function simpletest_clean_database in SimpleTest 6

Same name and namespace in other branches
  1. 8.3 simpletest.module \simpletest_clean_database()
  2. 6.2 simpletest.module \simpletest_clean_database()
  3. 7.2 simpletest.module \simpletest_clean_database()
  4. 7 simpletest.module \simpletest_clean_database()

Removed prefixed talbes from the database that are left over from crashed tests.

1 call to simpletest_clean_database()
simpletest_clean_environment in ./simpletest.module
Remove all temporary database tables and directories.

File

./simpletest.module, line 227

Code

function simpletest_clean_database() {
  $tables = simpletest_get_like_tables();
  $ret = array();
  foreach ($tables as $table) {
    db_drop_table($ret, $table);
  }
  if (count($ret) > 0) {
    drupal_set_message(t('Removed @count left over tables.', array(
      '@count' => count($ret),
    )));
  }
  else {
    drupal_set_message(t('No left over tables to remove.'));
  }
}