3a185a051682171a74dd3b7e8ac995316f9505b2
[yaffs-website] / web / core / modules / system / tests / modules / batch_test / src / Form / BatchTestMockForm.php
1 <?php
2
3 namespace Drupal\batch_test\Form;
4
5 use Drupal\Core\Form\FormBase;
6 use Drupal\Core\Form\FormStateInterface;
7
8 /**
9  * Generate form of id batch_test_mock_form.
10  *
11  * @internal
12  */
13 class BatchTestMockForm extends FormBase {
14
15   /**
16    * {@inheritdoc}
17    */
18   public function getFormId() {
19     return 'batch_test_mock_form';
20   }
21
22   /**
23    * {@inheritdoc}
24    */
25   public function buildForm(array $form, FormStateInterface $form_state) {
26     $form['test_value'] = [
27       '#title' => t('Test value'),
28       '#type' => 'textfield',
29     ];
30     $form['submit'] = [
31       '#type' => 'submit',
32       '#value' => t('Submit'),
33     ];
34
35     return $form;
36   }
37
38   /**
39    * {@inheritdoc}
40    */
41   public function submitForm(array &$form, FormStateInterface $form_state) {
42     batch_test_stack('mock form submitted with value = ' . $form_state->getValue('test_value'));
43   }
44
45 }