diff --git modules/node/node.test modules/node/node.test index 98472c1..96d38d2 100644 --- modules/node/node.test +++ modules/node/node.test @@ -350,7 +350,7 @@ class PageEditTestCase extends DrupalWebTestCase { // Check that the title and body fields are displayed with the correct values. $this->assertLink(t('Edit'), 0, t('Edit tab found.')); $this->assertFieldByName('title', $edit['title'], t('Title field displayed.')); - $this->assertFieldByName('body', '' . $edit['body'], t('Body field displayed.')); + $this->assertFieldByName('body', $edit['body'], t('Body field displayed.')); // Edit the content of the node. $edit = array(); @@ -398,7 +398,7 @@ class PagePreviewTestCase extends DrupalWebTestCase { // Check that the title and body fields are displayed with the correct values. $this->assertFieldByName('title', $edit['title'], t('Title field displayed.')); - $this->assertFieldByName('body', '' . $edit['body'], t('Body field displayed.')); + $this->assertFieldByName('body', $edit['body'], t('Body field displayed.')); } } diff --git modules/simpletest/drupal_web_test_case.php modules/simpletest/drupal_web_test_case.php index a8db177..ba09253 100644 --- modules/simpletest/drupal_web_test_case.php +++ modules/simpletest/drupal_web_test_case.php @@ -1253,7 +1253,7 @@ class DrupalWebTestCase { } break; case 'checkbox': - // To prevent checkbox from being checked.pass in a FALSE, + // To prevent checkbox from being checked, pass in a FALSE, // otherwise the checkbox will be set to its value regardless // of $edit. if ($edit[$name] === FALSE) { @@ -1292,6 +1292,16 @@ class DrupalWebTestCase { break; } } + else { + // Ignore empty disabled elements, as those should not be 'successful' + // (i.e., valid for form submission), according to + // http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.12 + // Note that if we have a value for a disabled field, we still allow it + // to be submitted -- we don't "babysit" the code that's being tested. + if (!empty($element['disabled'])) { + continue; + } + } if (!isset($post[$name]) && !$done) { switch ($type) { case 'textarea':