diff --git a/core/modules/system/tests/modules/batch_test/batch_test.module b/core/modules/system/tests/modules/batch_test/batch_test.module index c7dddd6..d08d293 100644 --- a/core/modules/system/tests/modules/batch_test/batch_test.module +++ b/core/modules/system/tests/modules/batch_test/batch_test.module @@ -76,34 +76,7 @@ function batch_test_menu() { */ function _batch_test_nested_drupal_form_submit_callback($value) { $state['values']['test_value'] = $value; - drupal_form_submit('batch_test_mock_form', $state); -} - -/** - * Form constructor for a simple form with a textfield and submit button. - * - * @see batch_test_mock_form_submit() - */ -function batch_test_mock_form($form, $form_state) { - $form['test_value'] = array( - '#title' => t('Test value'), - '#type' => 'textfield', - ); - $form['submit'] = array( - '#type' => 'submit', - '#value' => t('Submit'), - ); - - return $form; -} - -/** - * Form submission handler for batch_test_mock_form(). - * - * @see batch_test_mock_form() - */ -function batch_test_mock_form_submit($form, &$form_state) { - batch_test_stack('mock form submitted with value = ' . $form_state['values']['test_value']); + \Drupal::formBuilder()->submitForm('Drupal\batch_test\Form\BatchTestMockForm', $state); } /** diff --git a/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Form/BatchTestChainedForm.php b/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Form/BatchTestChainedForm.php index e84eece..bc36db0 100644 --- a/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Form/BatchTestChainedForm.php +++ b/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Form/BatchTestChainedForm.php @@ -7,12 +7,12 @@ namespace Drupal\batch_test\Form; -use \Drupal\Core\Form\FormBase; +use \Drupal\Core\Form\FormInterface; /** * Generate form of id batch_test_chained_form. */ -class BatchTestChainedForm extends FormBase{ +class BatchTestChainedForm implements FormInterface { /** * {@inheritdoc} diff --git a/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Form/BatchTestMockForm.php b/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Form/BatchTestMockForm.php new file mode 100644 index 0000000..9924924 --- /dev/null +++ b/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Form/BatchTestMockForm.php @@ -0,0 +1,47 @@ + t('Test value'), + '#type' => 'textfield', + ); + $form['submit'] = array( + '#type' => 'submit', + '#value' => t('Submit'), + ); + + return $form; + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, array &$form_state) { + batch_test_stack('mock form submitted with value = ' . $form_state['values']['test_value']); + } + +} diff --git a/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Form/BatchTestMultiStepForm.php b/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Form/BatchTestMultiStepForm.php index d299cb0..74bbe48 100644 --- a/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Form/BatchTestMultiStepForm.php +++ b/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Form/BatchTestMultiStepForm.php @@ -7,12 +7,12 @@ namespace Drupal\batch_test\Form; -use \Drupal\Core\Form\FormBase; +use \Drupal\Core\Form\FormInterface; /** * Generate form of id batch_test_multistep_form. */ -class BatchTestMultiStepForm extends FormBase{ +class BatchTestMultiStepForm implements FormInterface { /** * {@inheritdoc} diff --git a/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Form/BatchTestSimpleForm.php b/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Form/BatchTestSimpleForm.php index bc61ead..4e79a76 100644 --- a/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Form/BatchTestSimpleForm.php +++ b/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Form/BatchTestSimpleForm.php @@ -7,12 +7,12 @@ namespace Drupal\batch_test\Form; -use \Drupal\Core\Form\FormBase; +use \Drupal\Core\Form\FormInterface; /** * Generate form of id batch_test_simple_form. */ -class BatchTestSimpleForm extends FormBase{ +class BatchTestSimpleForm implements FormInterface { /** * {@inheritdoc}