### 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.71
diff -u -r1.71 drupal_test_case.php
--- drupal_test_case.php	29 Mar 2008 21:10:48 -0000	1.71
+++ drupal_test_case.php	29 Mar 2008 22:13:41 -0000
@@ -877,15 +877,38 @@
     return $this->assertTrue($fields && (!$value || $fields[0]['value'] == $value), $message);
   }
 
+  function assertNoFieldByXPath($xpath, $value, $message) {
+    $fields = array();
+    if ($this->parse()) {
+      $fields = $this->elements->xpath($xpath);
+    }
+    return $this->assertFalse($fields && (!$value || $fields[0]['value'] == $value), $message);
+  }
+
   function assertFieldByName($name, $value = '', $message = '') {
     return $this->assertFieldByXPath($this->_constructFieldXpath('name', $name), $value, $message ? $message : t(' [browser] found field by name @name', array('@name' => $name)));
   }
+
+  function assertNoFieldByName($name, $value = '', $message = '') {
+    return $this->assertFieldByXPath($this->_constructFieldXpath('name', $name), $value, $message ? $message : t(' [browser] did not find field by name @name', array('@name' => $name)));
+  }
+
   function assertFieldById($id, $value = '', $message = '') {
-    return $this->assertFieldByXPath($this->_constructFieldXpath('id', $id), $value, $message ? $message : t(' [browser] found field by id @id', array('@id' => $id)));
+    return $this->assertNoFieldByXPath($this->_constructFieldXpath('id', $id), $value, $message ? $message : t(' [browser] found field by id @id', array('@id' => $id)));
   }
+
+  function assertNoFieldById($id, $value = '', $message = '') {
+    return $this->assertNoFieldByXPath($this->_constructFieldXpath('id', $id), $value, $message ? $message : t(' [browser] did not find field by id @id', array('@id' => $id)));
+  }
+
   function assertField($field, $message = '') {
     return $this->assertFieldByXPath($this->_constructFieldXpath('name', $field) .'|'. $this->_constructFieldXpath('id', $field), '', $message);
   }
+
+  function assertNoField($field, $message = '') {
+    return $this->assertNoFieldByXPath($this->_constructFieldXpath('name', $field) .'|'. $this->_constructFieldXpath('id', $field), '', $message);
+  }
+
   function _constructFieldXpath($attribute, $value) {
     return '//textarea[@'. $attribute .'="'. $value .'"]|//input[@'. $attribute .'="'. $value .'"]|//select[@'. $attribute .'="'. $value .'"]';
   }
