diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/FileInclusionTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/FileInclusionTest.php deleted file mode 100644 index 3698067..0000000 --- a/core/modules/system/lib/Drupal/system/Tests/Form/FileInclusionTest.php +++ /dev/null @@ -1,47 +0,0 @@ - 'Form API file inclusion', - 'description' => 'Tests form API file inclusion.', - 'group' => 'Form API', - ); - } - - /** - * Tests loading an include specified in hook_menu(). - */ - function testLoadMenuInclude() { - $this->drupalPostAjaxForm('form-test/load-include-menu', array(), array('op' => t('Save')), 'system/ajax', array(), array(), 'form-test-load-include-menu'); - $this->assertText('Submit callback called.'); - } - - /** - * Tests loading a custom specified include. - */ - function testLoadCustomInclude() { - $this->drupalPostForm('form-test/load-include-custom', array(), t('Save')); - $this->assertText('Submit callback called.'); - } -} diff --git a/core/modules/system/tests/modules/form_test/form_test.file.inc b/core/modules/system/tests/modules/form_test/form_test.file.inc deleted file mode 100644 index 28a8622..0000000 --- a/core/modules/system/tests/modules/form_test/form_test.file.inc +++ /dev/null @@ -1,50 +0,0 @@ - '
', - ); - $form['button'] = array( - '#type' => 'submit', - '#value' => t('Save'), - '#submit' => array('form_test_load_include_submit'), - '#ajax' => array( - 'wrapper' => $ajax_wrapper_id, - 'method' => 'append', - 'callback' => 'form_test_load_include_menu_ajax', - ), - ); - return $form; -} - -/** - * Submit callback for the form API file inclusion test forms. - */ -function form_test_load_include_submit($form, $form_state) { - drupal_set_message('Submit callback called.'); -} - -/** - * Ajax callback for the file inclusion via menu test. - */ -function form_test_load_include_menu_ajax($form) { - // We don't need to return anything, since #ajax['method'] is 'append', which - // does not remove the original #ajax['wrapper'] element, and status messages - // are automatically added by the Ajax framework as long as there's a wrapper - // element to add them to. - return ''; -} diff --git a/core/modules/system/tests/modules/form_test/form_test.module b/core/modules/system/tests/modules/form_test/form_test.module index 35a107b..7a753e1 100644 --- a/core/modules/system/tests/modules/form_test/form_test.module +++ b/core/modules/system/tests/modules/form_test/form_test.module @@ -1989,26 +1989,6 @@ function form_test_user_register_form_rebuild($form, &$form_state) { $form_state['rebuild'] = TRUE; } -/** - * Menu callback for testing custom form includes. - * - * @deprecated Use \Drupal\form_test\testLoadIncludeCustom() - */ -function form_test_load_include_custom($form, &$form_state) { - $form['button'] = array( - '#type' => 'submit', - '#value' => t('Save'), - '#submit' => array('form_test_load_include_submit'), - ); - // Specify the include file and enable form caching. That way the form is - // cached when it is submitted, but needs to find the specified submit handler - // in the include. - // Filename is a bit weird here: modules/system/tests/form_test.file.inc - form_load_include($form_state, 'inc', 'form_test', 'form_test.file'); - $form_state['cache'] = TRUE; - return $form; -} - function form_test_checkbox_type_juggling($form, $form_state, $default_value, $return_value) { $form['checkbox'] = array( '#title' => t('Checkbox'), diff --git a/core/modules/system/tests/modules/form_test/form_test.routing.yml b/core/modules/system/tests/modules/form_test/form_test.routing.yml index 96d1bc7..0067dc5 100644 --- a/core/modules/system/tests/modules/form_test/form_test.routing.yml +++ b/core/modules/system/tests/modules/form_test/form_test.routing.yml @@ -166,7 +166,7 @@ form_test.tableselect_empty_text: _access: 'TRUE' form_test.tableselect_js: - path: '/form_test/tableselect/advanced-select' + path: '/form_test/tableselect/advanced-select/{test_action}' defaults: _content: '\Drupal\form_test\Form\FormTestForm::testTableSelectJS' _title: 'Tableselect js_select tests' @@ -365,27 +365,12 @@ form_test.clicked_button: requirements: _access: 'TRUE' -form_test.load_include_menu: - path: '/form-test/load-include-menu' - defaults: - _content: '\Drupal\form_test\Form\FormTestForm::testLoadIncludeMenu' - _title: 'FAPI test loading includes' - requirements: - _access: 'TRUE' - -form_test.load_include_custom: - path: '/form-test/load-include-custom' - defaults: - _content: '\Drupal\form_test\Form\FormTestForm::testLoadIncludeCustom' - _title: 'FAPI test loading includes' - requirements: - _access: 'TRUE' - form_test.checkboxes_zero: - path: '/form-test/checkboxes-zero' + path: '/form-test/checkboxes-zero/{json}' defaults: _content: '\Drupal\form_test\Form\FormTestForm::testCheckboxesZero' _title: 'FAPI test involving checkboxes and zero' + json: TRUE requirements: _access: 'TRUE' diff --git a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/Form/FormTestForm.php b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/Form/FormTestForm.php index 45cd9a2..ba1c7fb 100644 --- a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/Form/FormTestForm.php +++ b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/Form/FormTestForm.php @@ -107,8 +107,8 @@ public function testTableSelectEmptyText() { * * @todo Remove _form_test_tableselect_js_select_form(). */ - public function testTableSelectJS() { - return drupal_get_form('_form_test_tableselect_js_select_form'); + public function testTableSelectJS($test_action) { + return drupal_get_form('_form_test_tableselect_js_select_form', $test_action); } /** @@ -162,7 +162,7 @@ public function testFormStateCleanAdvanced() { * @todo Remove _form_test_checkbox(). */ public function testCheckbox() { - return drupal_get_form('form_test_checkbox'); + return drupal_get_form('_form_test_checkbox'); } /** @@ -252,7 +252,7 @@ public function testColor() { * @todo Remove form_test_checkboxes_radios(). */ public function testCheckboxesRadios() { - return drupal_get_form('form_test_checkboxes_radio'); + return drupal_get_form('form_test_checkboxes_radios'); } /** @@ -337,31 +337,12 @@ public function testClickedButton() { } /** - * Wraps form_test_load_include_menu(). - * - * @todo Remove form_test_load_include_menu(). - */ - public function testLoadIncludeMenu() { - module_load_include('file.inc', 'form_test'); - return drupal_get_form('form_test_load_include_menu'); - } - - /** - * Wraps form_test_load_include_custom(). - * - * @todo Remove form_test_load_include_custom(). - */ - public function testLoadIncludeCustom() { - return drupal_get_form('form_test_load_include_custom'); - } - - /** * Wraps form_test_checkboxes_zero(). * * @todo Remove form_test_checkboxes_zero(). */ - public function testCheckboxesZero() { - return drupal_get_form('form_test_checkboxes_zero'); + public function testCheckboxesZero($json) { + return drupal_get_form('form_test_checkboxes_zero', $json); } /**