class StubForm
Same name and namespace in other branches
- 11.x core/modules/system/tests/src/Functional/Form/StubForm.php \Drupal\Tests\system\Functional\Form\StubForm
- 10 core/modules/system/tests/src/Functional/Form/StubForm.php \Drupal\Tests\system\Functional\Form\StubForm
- 8.9.x core/modules/system/tests/src/Functional/Form/StubForm.php \Drupal\Tests\system\Functional\Form\StubForm
Provides a stub form for testing purposes.
@internal
Hierarchy
- class \Drupal\Core\Form\FormBase extends \Drupal\Core\Form\FormInterface, \Drupal\Core\DependencyInjection\ContainerInjectionInterface uses \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Logger\LoggerChannelTrait, \Drupal\Core\Messenger\MessengerTrait, \Drupal\Core\Routing\RedirectDestinationTrait, \Drupal\Core\StringTranslation\StringTranslationTrait
- class \Drupal\Tests\system\Functional\Form\StubForm implements \Drupal\Core\Form\FormBase
Expanded class hierarchy of StubForm
File
-
core/
modules/ system/ tests/ src/ Functional/ Form/ StubForm.php, line 13
Namespace
Drupal\Tests\system\Functional\FormView source
class StubForm extends FormBase {
/**
* The form array.
*
* @var array
*/
protected $form;
/**
* The form ID.
*
* @var string
*/
protected $formId;
/**
* Constructs a StubForm.
*
* @param string $form_id
* The form ID.
* @param array $form
* The form array.
*/
public function __construct($form_id, $form) {
$this->formId = $form_id;
$this->form = $form;
}
/**
* {@inheritdoc}
*/
public function getFormId() {
return $this->formId;
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
return $this->form;
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.