You are here

FormTestAlterForm.php in Drupal 9

File

core/modules/system/tests/modules/form_test/src/Form/FormTestAlterForm.php
View source
<?php

namespace Drupal\form_test\Form;

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

/**
 * Form builder for testing hook_form_alter() and hook_form_FORM_ID_alter().
 *
 * @internal
 */
class FormTestAlterForm extends FormBase {

  /**
   * {@inheritdoc}
   */
  public function getFormId() {
    return 'form_test_alter_form';
  }

  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {

    // Elements can be added as needed for future testing needs, but for now,
    // we're only testing alter hooks that do not require any elements added by
    // this function.
    return $form;
  }

  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
  }

}

Classes

Namesort descending Description
FormTestAlterForm Form builder for testing hook_form_alter() and hook_form_FORM_ID_alter().