3 namespace Drupal\batch_test\Form;
5 use Drupal\Core\Form\FormBase;
6 use Drupal\Core\Form\FormStateInterface;
9 * Generate form of id batch_test_mock_form.
11 class BatchTestMockForm extends FormBase {
16 public function getFormId() {
17 return 'batch_test_mock_form';
23 public function buildForm(array $form, FormStateInterface $form_state) {
24 $form['test_value'] = [
25 '#title' => t('Test value'),
26 '#type' => 'textfield',
30 '#value' => t('Submit'),
39 public function submitForm(array &$form, FormStateInterface $form_state) {
40 batch_test_stack('mock form submitted with value = ' . $form_state->getValue('test_value'));