Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[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  * @internal
12  */
13 class StubForm extends FormBase {
14
15   /**
16    * The form array.
17    *
18    * @var array
19    */
20   protected $form;
21
22   /**
23    * The form ID.
24    *
25    * @var string
26    */
27   protected $formId;
28
29   /**
30    * Constructs a StubForm.
31    *
32    * @param string $form_id
33    *   The form ID.
34    * @param array $form
35    *   The form array.
36    */
37   public function __construct($form_id, $form) {
38     $this->formId = $form_id;
39     $this->form = $form;
40   }
41
42   /**
43    * {@inheritdoc}
44    */
45   public function getFormId() {
46     $this->formId;
47   }
48
49   /**
50    * {@inheritdoc}
51    */
52   public function buildForm(array $form, FormStateInterface $form_state) {
53     return $this->form;
54   }
55
56   /**
57    * {@inheritdoc}
58    */
59   public function submitForm(array &$form, FormStateInterface $form_state) {
60   }
61
62 }