diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2008-09-05 19:04:26 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2008-09-05 19:04:26 +0000 |
commit | cbb639a16ffec82f498ae689818b010e040bf5b4 (patch) | |
tree | d48102ca0bc5d6c6dde09f7e49b9f75ff040a52a /modules | |
parent | e717628401a6d5ee9bbda0e64937a50b7a24410e (diff) | |
download | brdo-cbb639a16ffec82f498ae689818b010e040bf5b4.tar.gz brdo-cbb639a16ffec82f498ae689818b010e040bf5b4.tar.bz2 |
#298444 by c960657: Fix exceptions in DBLog test.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/dblog/dblog.test | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/modules/dblog/dblog.test b/modules/dblog/dblog.test index 258e46601..376e0e2be 100644 --- a/modules/dblog/dblog.test +++ b/modules/dblog/dblog.test @@ -211,19 +211,14 @@ class DBLogTestCase extends DrupalWebTestCase { $count = db_result(db_query('SELECT COUNT(wid) FROM {watchdog} WHERE uid = %d', $user->uid)); $this->assertTrue($count == 0, t('DBLog contains @count records for @name', array('@count' => $count, '@name' => $user->name))); - // Fetch row ids in watchdog that previously related to the deleted user. + // Count rows in watchdog that previously related to the deleted user. $select = db_select('watchdog'); - $select->addField('watchdog', 'wid'); + $select->addExpression('COUNT(*)'); $select->condition('uid', 0); if ($ids) { $select->condition('wid', $ids, 'IN'); } - $result = $select->execute(); - unset($ids); - foreach ($result as $row) { - $ids[] = $row->wid; - } - $count_after = (isset($ids)) ? count($ids) : 0; + $count_after = $select->execute()->fetchField(); $this->assertTrue($count_after == $count_before, t('DBLog contains @count records for @name that now have uid = 0', array('@count' => $count_before, '@name' => $user->name))); unset($ids); // Fetch row ids in watchdog that relate to the user. |