diff --git a/core/modules/simpletest/tests/form.test b/core/modules/simpletest/tests/form.test index 4eefff462c9daaef35fa20910fb01a37ef2e153a..d3c59076947ace066dac8953c2ecfc315df36562 100644 --- a/core/modules/simpletest/tests/form.test +++ b/core/modules/simpletest/tests/form.test @@ -261,7 +261,7 @@ class FormsTestCase extends DrupalWebTestCase { // All the elements should be marked as disabled, including the ones below // the disabled container. - $this->assertEqual(count($disabled_elements), 34, t('The correct elements have the disabled property in the HTML code.')); + $this->assertEqual(count($disabled_elements), 35, 'The correct elements have the disabled property in the HTML code.'); $this->drupalPost(NULL, $edit, t('Submit')); $returned_values['hijacked'] = drupal_json_decode($this->content); @@ -396,7 +396,7 @@ class FormElementTestCase extends DrupalWebTestCase { $this->drupalGet('form-test/placeholder-text'); $expected = 'placeholder-text'; // Test to make sure non-textarea elements have the proper placeholder text. - foreach (array('textfield', 'tel', 'password') as $type) { + foreach (array('textfield', 'tel', 'password', 'email') as $type) { $element = $this->xpath('//input[@id=:id and @placeholder=:expected]', array( ':id' => 'edit-' . $type, ':expected' => $expected, diff --git a/core/modules/simpletest/tests/form_test.module b/core/modules/simpletest/tests/form_test.module index a64fb62e278638718ce8612db0fe749dfbf9036a..6e76badf4bc83ccd070526b490772746868cfda8 100644 --- a/core/modules/simpletest/tests/form_test.module +++ b/core/modules/simpletest/tests/form_test.module @@ -1033,7 +1033,7 @@ function form_test_select_submit($form, &$form_state) { * Builds a form to test the placeholder attribute. */ function form_test_placeholder_test($form, &$form_state) { - foreach (array('textfield', 'textarea', 'password', 'tel') as $type) { + foreach (array('textfield', 'textarea', 'password', 'tel', 'email') as $type) { $form[$type] = array( '#type' => $type, '#title' => $type, @@ -1244,6 +1244,14 @@ function _form_test_disabled_elements($form, &$form_state) { ); } + // Try to hijack the email field with a valid email. + $form['disabled_container']['disabled_container_email'] = array( + '#type' => 'email', + '#title' => 'email', + '#default_value' => 'foo@example.com', + '#test_hijack_value' => 'bar@example.com', + ); + // Text format. $form['text_format'] = array( '#type' => 'text_format',