Commit cf77b6e8 authored by Dries's avatar Dries

- Patch #1174620 by Niklas Fiekas, Dave Reid, ericduran: Added new HTML5 FAPI element: email.

parent c94c22ed
......@@ -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,
......
......@@ -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',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment