summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests/form.test
diff options
context:
space:
mode:
Diffstat (limited to 'modules/simpletest/tests/form.test')
-rw-r--r--modules/simpletest/tests/form.test30
1 files changed, 30 insertions, 0 deletions
diff --git a/modules/simpletest/tests/form.test b/modules/simpletest/tests/form.test
index 6a7f26c3d..3debf4042 100644
--- a/modules/simpletest/tests/form.test
+++ b/modules/simpletest/tests/form.test
@@ -835,6 +835,36 @@ class FormsElementsTableSelectFunctionalTest extends DrupalWebTestCase {
}
/**
+ * Test the vertical_tabs form element for expected behavior.
+ */
+class FormsElementsVerticalTabsFunctionalTest extends DrupalWebTestCase {
+
+ public static function getInfo() {
+ return array(
+ 'name' => 'Vertical tabs form element type test',
+ 'description' => 'Test the vertical_tabs element for expected behavior',
+ 'group' => 'Form API',
+ );
+ }
+
+ function setUp() {
+ parent::setUp('form_test');
+ }
+
+ /**
+ * Ensures that vertical-tabs.js is included before collapse.js.
+ *
+ * Otherwise, collapse.js adds "SHOW" or "HIDE" labels to the tabs.
+ */
+ function testJavaScriptOrdering() {
+ $this->drupalGet('form_test/vertical-tabs');
+ $position1 = strpos($this->content, 'misc/vertical-tabs.js');
+ $position2 = strpos($this->content, 'misc/collapse.js');
+ $this->assertTrue($position1 !== FALSE && $position2 !== FALSE && $position1 < $position2, t('vertical-tabs.js is included before collapse.js'));
+ }
+}
+
+/**
* Test the form storage on a multistep form.
*
* The tested form puts data into the storage during the initial form