Index: modules/simpletest/tests/common.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/common.test,v
retrieving revision 1.101
diff -u -9 -p -r1.101 common.test
--- modules/simpletest/tests/common.test	9 Jan 2010 23:36:55 -0000	1.101
+++ modules/simpletest/tests/common.test	10 Jan 2010 12:10:26 -0000
@@ -1600,38 +1600,46 @@ class DrupalErrorCollectionUnitTest exte
     }
     else {
       // Give back the errors to the log report.
       foreach ($this->collectedErrors as $error) {
         parent::error($error['message'], $error['group'], $error['caller']);
       }
     }
   }
 
+  /**
+   * Overrides DrupalWebTestCase::error().
+   */
   protected function error($message = '', $group = 'Other', array $caller = NULL) {
-    // This function overiddes DrupalWebTestCase::error(). We collect an error...
-    $this->collectedErrors[] = array(
-      'message' => $message,
-      'group' => $group,
-      'caller' => $caller
-    );
-    // ... and ignore it.
+    if (strpos($message, t('Verbose message')) !== FALSE) {
+      // Verbose messages are not errors and are thus passed on to the real
+      // error handler.
+      parent::error($message, $group, $caller);
+    }
+    else {
+      // Collect the errors generated by this class. Do not pass them on to the
+      // real error handler, because tests are not supposed to generate errors.
+      $this->collectedErrors[] = array(
+        'message' => $message,
+        'group' => $group,
+        'caller' => $caller
+      );
+    }
   }
 
   /**
    * Assert that a collected error matches what we are expecting.
    */
-  function assertError($error, $group, $function, $file, $message = NULL) {
+  function assertError($error, $group, $function, $file, $message) {
     $this->assertEqual($error['group'], $group, t("Group was %group", array('%group' => $group)));
     $this->assertEqual($error['caller']['function'], $function, t("Function was %function", array('%function' => $function)));
     $this->assertEqual(basename($error['caller']['file']), $file, t("File was %file", array('%file' => $file)));
-    if (isset($message)) {
-      $this->assertEqual($error['message'], $message, t("Message was %message", array('%message' => $message)));
-    }
+    $this->assertEqual($error['message'], $message, t('Message was %message', array('%message' => $message)));
   }
 }
 
 /**
  * Test the drupal_parse_info_file() API function.
  */
 class ParseInfoFilesTestCase extends DrupalWebTestCase {
   public static function getInfo() {
     return array(
