summaryrefslogtreecommitdiff
path: root/modules/simpletest/simpletest.module
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-10-24 23:12:11 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-10-24 23:12:11 +0000
commit47328efca6b662587929208a0646f6fdbbb759ee (patch)
tree26bb3dab3b44feeaf8a3d2138d041997b31c7f59 /modules/simpletest/simpletest.module
parent09f2d3266bffc78d12d8666e2b3202dedd2cfc8f (diff)
downloadbrdo-47328efca6b662587929208a0646f6fdbbb759ee.tar.gz
brdo-47328efca6b662587929208a0646f6fdbbb759ee.tar.bz2
#608870 by c960657: Fixed notice in simpletest_clean_database().
Diffstat (limited to 'modules/simpletest/simpletest.module')
-rw-r--r--modules/simpletest/simpletest.module6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/simpletest/simpletest.module b/modules/simpletest/simpletest.module
index 1757deb34..4d1ea4161 100644
--- a/modules/simpletest/simpletest.module
+++ b/modules/simpletest/simpletest.module
@@ -418,16 +418,18 @@ function simpletest_clean_environment() {
function simpletest_clean_database() {
$tables = db_find_tables(Database::getConnection()->prefixTables('{simpletest}') . '%');
$schema = drupal_get_schema_unprocessed('simpletest');
+ $count = 0;
foreach (array_diff_key($tables, $schema) as $table) {
// Strip the prefix and skip tables without digits following "simpletest",
// e.g. {simpletest_test_id}.
if (preg_match('/simpletest\d+.*/', $table, $matches)) {
db_drop_table($matches[0]);
+ $count++;
}
}
- if (count($ret) > 0) {
- drupal_set_message(format_plural(count($ret), 'Removed 1 leftover table.', 'Removed @count leftover tables.'));
+ if ($count > 0) {
+ drupal_set_message(format_plural($count, 'Removed 1 leftover table.', 'Removed @count leftover tables.'));
}
else {
drupal_set_message(t('No leftover tables to remove.'));