From d88bf38a7452c88667a80b8dde38f100e9449686 Mon Sep 17 00:00:00 2001
From: catch <catch@35733.no-reply.drupal.org>
Date: Thu, 1 Mar 2012 00:40:46 +0900
Subject: [PATCH] Issue #1174634 by Dave Reid: additional test coverage for new
 HTML5 FAPI element: telephone.

---
 core/modules/simpletest/tests/form.test        | 9 ++++-----
 core/modules/simpletest/tests/form_test.module | 2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/core/modules/simpletest/tests/form.test b/core/modules/simpletest/tests/form.test
index 784da8849c9b..6e40f1f9fc61 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), 33, t('The correct elements have the disabled property in the HTML code.'));
+    $this->assertEqual(count($disabled_elements), 34, t('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);
@@ -390,14 +390,13 @@ class FormElementTestCase extends DrupalWebTestCase {
   }
 
   /**
-   * Tests placeholder text for textfield, password, and textarea.
+   * Tests placeholder text for elements that support placeholders.
    */
   function testPlaceHolderText() {
     $this->drupalGet('form-test/placeholder-text');
     $expected = 'placeholder-text';
-    // Test to make sure textfields and passwords have the proper placeholder
-    // text.
-    foreach (array('textfield', 'password') as $type) {
+    // Test to make sure non-textarea elements have the proper placeholder text.
+    foreach (array('textfield', 'tel', 'password') 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 a2f1290cbf0c..76e5c260de3d 100644
--- a/core/modules/simpletest/tests/form_test.module
+++ b/core/modules/simpletest/tests/form_test.module
@@ -1196,7 +1196,7 @@ function _form_test_disabled_elements($form, &$form_state) {
   $form['disabled_container'] = array(
     '#disabled' => TRUE,
   );
-  foreach (array('textfield', 'textarea', 'hidden') as $type) {
+  foreach (array('textfield', 'textarea', 'hidden', 'tel') as $type) {
     $form['disabled_container']['disabled_container_' . $type] = array(
       '#type' => $type,
       '#title' => $type,
-- 
GitLab