Index: modules/simpletest/drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.196
diff -u -p -r1.196 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	9 Feb 2010 12:28:39 -0000	1.196
+++ modules/simpletest/drupal_web_test_case.php	13 Feb 2010 22:43:33 -0000
@@ -1691,6 +1691,18 @@ class DrupalWebTestCase extends DrupalTe
     foreach ($elements as $element) {
       // SimpleXML objects need string casting all the time.
       $name = (string) $element['name'];
+
+      // Generate a failure when disabled elements are set, as those cannot be 'successful' (ie. be part
+      // of form submissions), according to:
+      // http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.12
+      if (!empty($element['disabled'])) {
+        if (isset($edit[$name])) {
+          $this->fail(t('Field @name is disabled, sending of disabled fields is not allowed.', array('@name' => $name)));
+        }
+        unset($edit[$name]);
+        continue;
+     }
+
       // This can either be the type of <input> or the name of the tag itself
       // for <select> or <textarea>.
       $type = isset($element['type']) ? (string)$element['type'] : $element->getName();
Index: modules/user/user.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.test,v
retrieving revision 1.83
diff -u -p -r1.83 user.test
--- modules/user/user.test	11 Feb 2010 03:19:21 -0000	1.83
+++ modules/user/user.test	13 Feb 2010 22:43:40 -0000
@@ -87,7 +87,7 @@ class UserRegistrationTestCase extends D
     // Activate the new account.
     $accounts = user_load_multiple(array(), array('name' => $name, 'mail' => $mail));
     $new_user = reset($accounts);
-    $admin_user = $this->drupalCreateUser(array('administer users'));
+    $admin_user = $this->drupalCreateUser(array('administer users', 'administer permissions'));
     $this->drupalLogin($admin_user);
     $edit = array(
       'status' => 1,
