From fa94c66c92eaec0a636fa4f92b8496f7c38fc54a Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 1 Nov 2008 21:21:35 +0000 Subject: - Patch #328719 by c960657: make the module list tests succeed again. --- modules/simpletest/simpletest.module | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'modules/simpletest/simpletest.module') 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) { -- cgit v1.2.3