Index: drupal_test_case.php =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/simpletest/drupal_test_case.php,v retrieving revision 1.83 diff -u -p -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 09:29:04 -0000 @@ -1020,4 +1023,21 @@ class DrupalTestCase extends UnitTestCas $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))); } + + function getDrupalErrors() { + if ($this->parse()) { + $errors = $this->elements->xpath("//div[@class='messages errors']"); + 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); + } + } + } + } }