1.20.x simpletest.module simpletest_clean_profile_cache_tables()

Removes cached profile tables from the database.

File

modules/simpletest/simpletest.module, line 591
Provides testing functionality.

Code

function simpletest_clean_profile_cache_tables() {
  $tables = db_find_tables(Database::getConnection()->prefixTables('{simpletest_cache_}') . '%');
  $count = count($tables);
  foreach ($tables as $table) {
    db_drop_table($table);
  }

  if ($count > 0) {
    backdrop_set_message(format_plural($count, 'Removed 1 profile cache table.', 'Removed @count profile cache tables.'));
  }
  else {
    backdrop_set_message(t('No profile cache tables to remove.'));
  }
}