summaryrefslogtreecommitdiff
path: root/modules/simpletest/simpletest.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-11-01 21:21:35 +0000
committerDries Buytaert <dries@buytaert.net>2008-11-01 21:21:35 +0000
commitfa94c66c92eaec0a636fa4f92b8496f7c38fc54a (patch)
treee4256186f9897e9b062cf7bb9d5bd84170182bb8 /modules/simpletest/simpletest.module
parent424250196a65b48919de50b2a3327f67c076e0d3 (diff)
downloadbrdo-fa94c66c92eaec0a636fa4f92b8496f7c38fc54a.tar.gz
brdo-fa94c66c92eaec0a636fa4f92b8496f7c38fc54a.tar.bz2
- Patch #328719 by c960657: make the module list tests succeed again.
Diffstat (limited to 'modules/simpletest/simpletest.module')
-rw-r--r--modules/simpletest/simpletest.module9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/simpletest/simpletest.module b/modules/simpletest/simpletest.module
index 896b64f61..5275afb67 100644
--- a/modules/simpletest/simpletest.module
+++ b/modules/simpletest/simpletest.module
@@ -514,11 +514,16 @@ function simpletest_clean_environment() {
* Removed prefixed talbes from the database that are left over from crashed tests.
*/
function simpletest_clean_database() {
- $tables = db_find_tables(Database::getActiveConnection()->prefixTables('simpletest') . '%');
+ global $db_prefix;
+ $tables = db_find_tables(Database::getActiveConnection()->prefixTables('{simpletest}') . '%');
$schema = drupal_get_schema_unprocessed('simpletest');
$ret = array();
foreach (array_diff_key($tables, $schema) as $table) {
- db_drop_table($ret, $table);
+ // Strip $db_prefix and skip tables without digits following "simpletest",
+ // e.g. {simpletest_tets_id}.
+ if (preg_match('/simpletest\d+.*/', $table, $matches)) {
+ db_drop_table($ret, $matches[0]);
+ }
}
if (count($ret) > 0) {