Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / system / tests / src / Functional / Form / StubForm.php
1 <?php
2
3 namespace Drupal\Tests\system\Functional\Form;
4
5 use Drupal\Core\Form\FormBase;
6 use Drupal\Core\Form\FormStateInterface;
7
8 /**
9  * Provides a stub form for testing purposes.
10  */
11 class StubForm extends FormBase {
12
13   /**
14    * The form array.
15    *
16    * @var array
17    */
18   protected $form;
19
20   /**
21    * The form ID.
22    *
23    * @var string
24    */
25   protected $formId;
26
27   /**
28    * Constructs a StubForm.
29    *
30    * @param string $form_id
31    *   The form ID.
32    * @param array $form
33    *   The form array.
34    */
35   public function __construct($form_id, $form) {
36     $this->formId = $form_id;
37     $this->form = $form;
38   }
39
40   /**
41    * {@inheritdoc}
42    */
43   public function getFormId() {
44     $this->formId;
45   }
46
47   /**
48    * {@inheritdoc}
49    */
50   public function buildForm(array $form, FormStateInterface $form_state) {
51     return $this->form;
52   }
53
54   /**
55    * {@inheritdoc}
56    */
57   public function submitForm(array &$form, FormStateInterface $form_state) {
58   }
59
60 }