summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-12-21 21:00:17 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-12-21 21:00:17 +0000
commitca89559273d37e0f8da1cbfce6e649ce27caf54f (patch)
tree9bf39465088cc9cad403ba29f08cc87f4f7e8d03 /modules
parent0e78333485da11ff44b3663d48d39df01f49513a (diff)
downloadbrdo-ca89559273d37e0f8da1cbfce6e649ce27caf54f.tar.gz
brdo-ca89559273d37e0f8da1cbfce6e649ce27caf54f.tar.bz2
#954804 follow-up by effulgentsia: Fix bugs related to library weighting.
Diffstat (limited to 'modules')
-rw-r--r--modules/simpletest/tests/form.test30
-rw-r--r--modules/simpletest/tests/form_test.module38
-rw-r--r--modules/system/system.module10
3 files changed, 73 insertions, 5 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
diff --git a/modules/simpletest/tests/form_test.module b/modules/simpletest/tests/form_test.module
index 142debf47..a816caab5 100644
--- a/modules/simpletest/tests/form_test.module
+++ b/modules/simpletest/tests/form_test.module
@@ -61,6 +61,14 @@ function form_test_menu() {
'type' => MENU_CALLBACK,
);
+ $items['form_test/vertical-tabs'] = array(
+ 'title' => 'Vertical tabs tests',
+ 'page callback' => 'drupal_get_form',
+ 'page arguments' => array('_form_test_vertical_tabs_form'),
+ 'access arguments' => array('access content'),
+ 'type' => MENU_CALLBACK,
+ );
+
$items['form_test/form-storage'] = array(
'title' => 'Form storage test',
'page callback' => 'drupal_get_form',
@@ -538,6 +546,36 @@ function _form_test_tableselect_js_select_form($form, $form_state, $action) {
}
/**
+ * Tests functionality of vertical tabs.
+ */
+function _form_test_vertical_tabs_form($form, &$form_state) {
+ $form['vertical_tabs'] = array(
+ '#type' => 'vertical_tabs',
+ );
+ $form['tab1'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Tab 1'),
+ '#collapsible' => TRUE,
+ '#group' => 'vertical_tabs',
+ );
+ $form['tab1']['field1'] = array(
+ '#title' => t('Field 1'),
+ '#type' => 'textfield',
+ );
+ $form['tab2'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Tab 2'),
+ '#collapsible' => TRUE,
+ '#group' => 'vertical_tabs',
+ );
+ $form['tab2']['field2'] = array(
+ '#title' => t('Field 2'),
+ '#type' => 'textfield',
+ );
+ return $form;
+}
+
+/**
* A multistep form for testing the form storage.
*
* It uses two steps for editing a virtual "thing". Any changes to it are saved
diff --git a/modules/system/system.module b/modules/system/system.module
index c58297db9..d6d822a82 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -1097,7 +1097,7 @@ function system_library() {
'title' => 'Drupal batch API',
'version' => VERSION,
'js' => array(
- 'misc/batch.js' => array('cache' => FALSE),
+ 'misc/batch.js' => array('group' => JS_DEFAULT, 'cache' => FALSE),
),
'dependencies' => array(
array('system', 'drupal.progress'),
@@ -1109,7 +1109,7 @@ function system_library() {
'title' => 'Drupal progress indicator',
'version' => VERSION,
'js' => array(
- 'misc/progress.js' => array('cache' => FALSE),
+ 'misc/progress.js' => array('group' => JS_DEFAULT, 'cache' => FALSE),
),
);
@@ -1136,7 +1136,7 @@ function system_library() {
'title' => 'Drupal collapsible fieldset',
'version' => VERSION,
'js' => array(
- 'misc/collapse.js' => array(),
+ 'misc/collapse.js' => array('group' => JS_DEFAULT),
),
'dependencies' => array(
// collapse.js relies on drupalGetSummary in form.js
@@ -1149,7 +1149,7 @@ function system_library() {
'title' => 'Drupal resizable textarea',
'version' => VERSION,
'js' => array(
- 'misc/textarea.js' => array(),
+ 'misc/textarea.js' => array('group' => JS_DEFAULT),
),
);
@@ -1158,7 +1158,7 @@ function system_library() {
'title' => 'Drupal autocomplete',
'version' => VERSION,
'js' => array(
- 'misc/autocomplete.js' => array(),
+ 'misc/autocomplete.js' => array('group' => JS_DEFAULT),
),
);