diff --git a/core/modules/field/tests/modules/field_test/field_test.routing.yml b/core/modules/field/tests/modules/field_test/field_test.routing.yml index 355dbff..b7ba00c 100644 --- a/core/modules/field/tests/modules/field_test/field_test.routing.yml +++ b/core/modules/field/tests/modules/field_test/field_test.routing.yml @@ -10,4 +10,4 @@ field_test.entity_nested_form: entity_2: type: 'entity:entity_test' requirements: - _permission: 'administer entity_test content' \ No newline at end of file + _permission: 'administer entity_test content' diff --git a/core/modules/file/tests/file_module_test.info.yml b/core/modules/file/tests/file_module_test/file_module_test.info.yml similarity index 100% rename from core/modules/file/tests/file_module_test.info.yml rename to core/modules/file/tests/file_module_test/file_module_test.info.yml diff --git a/core/modules/file/tests/file_module_test.module b/core/modules/file/tests/file_module_test/file_module_test.module similarity index 86% rename from core/modules/file/tests/file_module_test.module rename to core/modules/file/tests/file_module_test/file_module_test.module index f76488c..592bcaa 100644 --- a/core/modules/file/tests/file_module_test.module +++ b/core/modules/file/tests/file_module_test/file_module_test.module @@ -10,27 +10,13 @@ use Drupal\field\FieldInterface; /** - * Implements hook_menu(). - */ -function file_module_test_menu() { - $items = array(); - - $items['file/test'] = array( - 'title' => 'Managed file test', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('file_module_test_form'), - 'access arguments' => array('access content'), - ); - - return $items; -} - -/** * Form constructor for testing a 'managed_file' element. * * @see file_module_test_menu() * @see file_module_test_form_submit() * @ingroup forms + * + * @deprecated Use \Drupal\file_module_test\Form\FileModuleTestForm::managedFileTest() */ function file_module_test_form($form, &$form_state, $tree = TRUE, $extended = TRUE, $multiple = FALSE, $default_fids = NULL) { $form['#tree'] = (bool) $tree; diff --git a/core/modules/file/tests/file_module_test/file_module_test.routing.yml b/core/modules/file/tests/file_module_test/file_module_test.routing.yml new file mode 100644 index 0000000..5238cc8 --- /dev/null +++ b/core/modules/file/tests/file_module_test/file_module_test.routing.yml @@ -0,0 +1,10 @@ +file_module_test.managed_test: + path: '/file/test/{tree}/{extended}/{multiple}/{default_fids}' + defaults: + _content: '\Drupal\file_module_test\Form\FileModuleTestForm::managedFileTest' + tree: TRUE + extended: TRUE + multiple: FALSE + default_fids: NULL + requirements: + _permission: 'access content' diff --git a/core/modules/file/tests/file_module_test/lib/Drupal/file_module_test/Form/FileModuleTestForm.php b/core/modules/file/tests/file_module_test/lib/Drupal/file_module_test/Form/FileModuleTestForm.php new file mode 100644 index 0000000..fdd3cdb --- /dev/null +++ b/core/modules/file/tests/file_module_test/lib/Drupal/file_module_test/Form/FileModuleTestForm.php @@ -0,0 +1,22 @@ + 'Search_Embed_Form', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('search_embedded_form_form'), - 'access arguments' => array('search content'), - 'type' => MENU_CALLBACK, - ); - - return $items; -} - -/** * Form constructor for embedding search results for testing. * * @see search_embedded_form_form_submit(). + * + * @deprecated Use \Drupal\search_embedded_form\Form\SearchEmbeddedForm::testEmbeddedForm() */ function search_embedded_form_form($form, &$form_state) { $count = \Drupal::config('search_embedded_form.settings')->get('submitted'); diff --git a/core/modules/search/tests/modules/search_embedded_form/search_embedded_form.routing.yml b/core/modules/search/tests/modules/search_embedded_form/search_embedded_form.routing.yml new file mode 100644 index 0000000..20615ec --- /dev/null +++ b/core/modules/search/tests/modules/search_embedded_form/search_embedded_form.routing.yml @@ -0,0 +1,7 @@ +search_embedded_form.test_embedded_form: + path: '/search_embedded_form' + defaults: + _title: 'Search_Embed_Form' + _content: '\Drupal\search_embedded_form\Form\SearchEmbeddedForm::testEmbeddedForm' + requirements: + _permission: 'search content' diff --git a/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module b/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module index 175d593..31888d7 100644 --- a/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module +++ b/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module @@ -10,39 +10,9 @@ use Drupal\ajax_forms_test\Callbacks; /** - * Implements hook_menu(). - */ -function ajax_forms_test_menu() { - $items = array(); - $items['ajax_forms_test_get_form'] = array( - 'title' => 'AJAX forms simple form test', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('ajax_forms_test_simple_form'), - 'access callback' => TRUE, - ); - $items['ajax_forms_test_ajax_commands_form'] = array( - 'title' => 'AJAX forms AJAX commands test', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('ajax_forms_test_ajax_commands_form'), - 'access callback' => TRUE, - ); - $items['ajax_validation_test'] = array( - 'title' => 'AJAX Validation Test', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('ajax_forms_test_validation_form'), - 'access callback' => TRUE, - ); - $items['ajax_forms_test_lazy_load_form'] = array( - 'title' => 'AJAX forms lazy load test', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('ajax_forms_test_lazy_load_form'), - 'access callback' => TRUE, - ); - return $items; -} - -/** * Tests form_state['values'] during callback. + * + * @deprecated Use \Drupal\ajax_forms_test\Form\AjaxFormsTestForm::getForm() */ function ajax_forms_test_simple_form($form, &$form_state) { $object = new Callbacks(); @@ -95,6 +65,8 @@ function ajax_forms_test_simple_form($form, &$form_state) { /** * Form constructor for the Ajax Command display form. + * + * @deprecated Use \Drupal\ajax_forms_test\Form\AjaxFormsTestForm::commandsForm() */ function ajax_forms_test_ajax_commands_form($form, &$form_state) { $form = array(); @@ -462,6 +434,8 @@ function ajax_forms_test_advanced_commands_settings_with_merging_callback($form, * be able to trigger without causing validation of the "required_field". * * @see ajax_forms_test_validation_form_submit() + * + * @deprecated Use \Drupal\ajax_forms_test\Form\AjaxFormsTestForm::validationForm() */ function ajax_forms_test_validation_form($form, &$form_state) { @@ -534,6 +508,8 @@ function ajax_forms_test_validation_number_form_callback($form, $form_state) { /** * Form builder: Builds a form that triggers a simple AJAX callback. + * + * @deprecated Use \Drupal\ajax_forms_test\Form\AjaxFormsTestForm::lazyLoadForm() */ function ajax_forms_test_lazy_load_form($form, &$form_state) { // We attach a JavaScript setting, so that one of the generated AJAX commands diff --git a/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.routing.yml b/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.routing.yml new file mode 100644 index 0000000..a01db36 --- /dev/null +++ b/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.routing.yml @@ -0,0 +1,31 @@ +ajax_forms_test.get_form: + path: '/ajax_forms_test_get_form' + defaults: + _title: 'AJAX forms simple form test' + _content: '\Drupal\ajax_forms_test\Form\AjaxFormsTestForm::getForm' + requirements: + _access: 'TRUE' + +ajax_forms_test.commands_form: + path: '/ajax_forms_test_ajax_commands_form' + defaults: + _title: 'AJAX forms AJAX commands test' + _content: '\Drupal\ajax_forms_test\Form\AjaxFormsTestForm::commandsForm' + requirements: + _access: 'TRUE' + +ajax_forms_test.validation_test: + path: '/ajax_validation_test' + defaults: + _title: 'AJAX Validation Test' + _content: '\Drupal\ajax_forms_test\Form\AjaxFormsTestForm::validationForm' + requirements: + _access: 'TRUE' + +ajax_forms_test.lazy_load_form: + path: '/ajax_forms_test_lazy_load_form' + defaults: + _title: 'AJAX forms lazy load test' + _content: '\Drupal\ajax_forms_test\Form\AjaxFormsTestForm::lazyLoadForm' + requirements: + _access: 'TRUE' diff --git a/core/modules/system/tests/modules/ajax_forms_test/lib/Drupal/ajax_forms_test/Form/AjaxFormsTestForm.php b/core/modules/system/tests/modules/ajax_forms_test/lib/Drupal/ajax_forms_test/Form/AjaxFormsTestForm.php new file mode 100644 index 0000000..3a231ee --- /dev/null +++ b/core/modules/system/tests/modules/ajax_forms_test/lib/Drupal/ajax_forms_test/Form/AjaxFormsTestForm.php @@ -0,0 +1,43 @@ + 'Batch test', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('batch_test_simple_form'), - 'access callback' => TRUE, + 'route_name' => 'batch_test.test_form', ); // Simple form: one submit handler, setting a batch. $items['batch-test/simple'] = array( @@ -26,18 +24,14 @@ function batch_test_menu() { // Multistep form: two steps, each setting a batch. $items['batch-test/multistep'] = array( 'title' => 'Multistep', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('batch_test_multistep_form'), - 'access callback' => TRUE, + 'route_name' => 'batch_test.multistep', 'type' => MENU_LOCAL_TASK, 'weight' => 1, ); // Chained form: four submit handlers, several of which set a batch. $items['batch-test/chained'] = array( 'title' => 'Chained', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('batch_test_chained_form'), - 'access callback' => TRUE, + 'route_name' => 'batch_test.chained', 'type' => MENU_LOCAL_TASK, 'weight' => 2, ); @@ -80,6 +74,8 @@ function batch_test_menu() { * Form constructor for a batch selection form. * * @see batch_test_simple_form_submit() + * + * @deprecated Use \Drupal\batch_test\Form\BatchTestForm::testForm() */ function batch_test_simple_form() { $form['batch'] = array( @@ -120,6 +116,8 @@ function batch_test_simple_form_submit($form, &$form_state) { * Form constructor for a multistep form. * * @see batch_test_multistep_form_submit() + * + * @deprecated Use \Drupal\batch_test\Form\BatchTestForm::testMultistepForm() */ function batch_test_multistep_form($form, &$form_state) { if (empty($form_state['storage']['step'])) { @@ -170,6 +168,8 @@ function batch_test_multistep_form_submit($form, &$form_state) { * @see batch_test_chained_form_submit_3() * @see batch_test_chained_form_submit_3() * @see batch_test_chained_form_submit_4() + * + * @deprecated Use \Drupal\batch_test\Form\BatchTestForm::testChainedForm() */ function batch_test_chained_form() { // This value is used to test that $form_state persists through batched diff --git a/core/modules/system/tests/modules/batch_test/batch_test.routing.yml b/core/modules/system/tests/modules/batch_test/batch_test.routing.yml index 8199f03..afdba91 100644 --- a/core/modules/system/tests/modules/batch_test/batch_test.routing.yml +++ b/core/modules/system/tests/modules/batch_test/batch_test.routing.yml @@ -31,6 +31,30 @@ batch_test.no_form: requirements: _access: 'TRUE' +batch_test.test_form: + path: '/batch-test' + defaults: + _content: '\Drupal\batch_test\Form\BatchTestForm::testForm' + _title: 'Batch test' + requirements: + _access: 'TRUE' + +batch_test.multistep: + path: '/batch-test/multistep' + defaults: + _content: '\Drupal\batch_test\Form\BatchTestForm::testMultistepForm' + _title: 'Multistep' + requirements: + _access: 'TRUE' + +batch_test.chained: + path: '/batch-test/chained' + defaults: + _content: '\Drupal\batch_test\Form\BatchTestForm::testChainedForm' + _title: 'Chained' + requirements: + _access: 'TRUE' + batch_test.programmatic: path: '/batch-test/programmatic/{value}' defaults: diff --git a/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Form/BatchTestForm.php b/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Form/BatchTestForm.php new file mode 100644 index 0000000..af9dbc9 --- /dev/null +++ b/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Form/BatchTestForm.php @@ -0,0 +1,36 @@ + TRUE, - 'page callback' => 'drupal_get_form', - 'page arguments' => array('database_test_theme_tablesort'), - ); - return $items; -} - -/** * Runs db_query_temporary() and outputs the table name and its number of rows. * * We need to test that the table created is temporary, so we run it here, in a @@ -195,6 +183,8 @@ function database_test_tablesort_first() { /** * Outputs a form without setting a header sort. + * + * @deprecated \Drupal\database_test\Form\DatabaseTestForm::testTablesortDefaultSort() */ function database_test_theme_tablesort($form, &$form_state) { $header = array( diff --git a/core/modules/system/tests/modules/database_test/database_test.routing.yml b/core/modules/system/tests/modules/database_test/database_test.routing.yml index 46fa580..a6ca5de 100644 --- a/core/modules/system/tests/modules/database_test/database_test.routing.yml +++ b/core/modules/system/tests/modules/database_test/database_test.routing.yml @@ -32,3 +32,10 @@ database_test.tablesort_first: _content: '\Drupal\database_test\Controller\DatabaseTestController::testTablesortFirst' requirements: _access: 'TRUE' + +database_test.tablesort_default_sort: + path: '/database_test/tablesort_default_sort' + defaults: + _content: '\Drupal\database_test\Form\DatabaseTestForm::testTablesortDefaultSort' + requirements: + _access: 'TRUE' diff --git a/core/modules/system/tests/modules/database_test/lib/Drupal/database_test/Form/DatabaseTestForm.php b/core/modules/system/tests/modules/database_test/lib/Drupal/database_test/Form/DatabaseTestForm.php new file mode 100644 index 0000000..4ec7f50 --- /dev/null +++ b/core/modules/system/tests/modules/database_test/lib/Drupal/database_test/Form/DatabaseTestForm.php @@ -0,0 +1,22 @@ +