BatchTestMockForm.php

Same filename in other branches
  1. 8.9.x core/modules/system/tests/modules/batch_test/src/Form/BatchTestMockForm.php
  2. 10 core/modules/system/tests/modules/batch_test/src/Form/BatchTestMockForm.php
  3. 11.x core/modules/system/tests/modules/batch_test/src/Form/BatchTestMockForm.php

Namespace

Drupal\batch_test\Form

File

core/modules/system/tests/modules/batch_test/src/Form/BatchTestMockForm.php

View source
<?php

namespace Drupal\batch_test\Form;

use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;

/**
 * Generate form of id batch_test_mock_form.
 *
 * @internal
 */
class BatchTestMockForm extends FormBase {
    
    /**
     * {@inheritdoc}
     */
    public function getFormId() {
        return 'batch_test_mock_form';
    }
    
    /**
     * {@inheritdoc}
     */
    public function buildForm(array $form, FormStateInterface $form_state) {
        $form['test_value'] = [
            '#title' => t('Test value'),
            '#type' => 'textfield',
        ];
        $form['submit'] = [
            '#type' => 'submit',
            '#value' => t('Submit'),
        ];
        return $form;
    }
    
    /**
     * {@inheritdoc}
     */
    public function submitForm(array &$form, FormStateInterface $form_state) {
        batch_test_stack('mock form submitted with value = ' . $form_state->getValue('test_value'));
    }

}

Classes

Title Deprecated Summary
BatchTestMockForm Generate form of id batch_test_mock_form.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.