### Eclipse Workspace Patch 1.0
#P simpletest
Index: drupal_test_case.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/drupal_test_case.php,v
retrieving revision 1.83
diff -u -r1.83 drupal_test_case.php
--- drupal_test_case.php	5 Apr 2008 19:19:26 -0000	1.83
+++ drupal_test_case.php	7 Apr 2008 18:30:15 -0000
@@ -1020,4 +1020,24 @@
     $match = is_array($code) ? in_array($curl_code, $code) : $curl_code == $code;
     return $this->assertTrue($match, $message ? $message : t(' [browser] HTTP response expected !code, actual !curl_code', array('!code' => $code, '!curl_code' => $curl_code)));
   }
+
+  /**
+   * Pickup any error message in a the current page and assert as failures.
+   */
+  function assertDrupalErrors() {
+    if ($this->parse()) {
+      $errors = $this->elements->xpath("//div[@class='messages error']");
+      if (!empty($errors)) {
+        $errors = $errors[0];
+        if (isset($errors->ul)) {
+          foreach ($errors->ul->li as $li) {
+            $this->fail((string)$li);
+          }
+        }
+        else {
+          $this->fail((string)$errors);
+        }
+      }
+    }
+  }
 }
