Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
cf77b6e8
Commit
cf77b6e8
authored
Mar 05, 2012
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#1174620
by Niklas Fiekas, Dave Reid, ericduran: Added new HTML5 FAPI element: email.
parent
c94c22ed
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
core/modules/simpletest/tests/form.test
core/modules/simpletest/tests/form.test
+2
-2
core/modules/simpletest/tests/form_test.module
core/modules/simpletest/tests/form_test.module
+9
-1
No files found.
core/modules/simpletest/tests/form.test
View file @
cf77b6e8
...
...
@@ -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
),
3
4
,
t
(
'The correct elements have the disabled property in the HTML code.'
)
)
;
$this
->
assertEqual
(
count
(
$disabled_elements
),
3
5
,
'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
,
...
...
core/modules/simpletest/tests/form_test.module
View file @
cf77b6e8
...
...
@@ -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'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment