X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fsystem%2Ftests%2Fmodules%2Fform_test%2Fsrc%2FForm%2FFormTestStorageForm.php;fp=web%2Fcore%2Fmodules%2Fsystem%2Ftests%2Fmodules%2Fform_test%2Fsrc%2FForm%2FFormTestStorageForm.php;h=5cc09b72806905ae5e030b277a70779643cd50e1;hp=f81658d537d79d9f129849f8f016f499c267c4d6;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/system/tests/modules/form_test/src/Form/FormTestStorageForm.php b/web/core/modules/system/tests/modules/form_test/src/Form/FormTestStorageForm.php index f81658d53..5cc09b728 100644 --- a/web/core/modules/system/tests/modules/form_test/src/Form/FormTestStorageForm.php +++ b/web/core/modules/system/tests/modules/form_test/src/Form/FormTestStorageForm.php @@ -50,7 +50,7 @@ class FormTestStorageForm extends FormBase { } // Count how often the form is constructed. $_SESSION['constructions']++; - drupal_set_message("Form constructions: " . $_SESSION['constructions']); + $this->messenger()->addStatus("Form constructions: " . $_SESSION['constructions']); $form['title'] = [ '#type' => 'textfield', @@ -136,10 +136,10 @@ class FormTestStorageForm extends FormBase { * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { - drupal_set_message("Title: " . Html::escape($form_state->getValue('title'))); - drupal_set_message("Form constructions: " . $_SESSION['constructions']); + $this->messenger()->addStatus("Title: " . Html::escape($form_state->getValue('title'))); + $this->messenger()->addStatus("Form constructions: " . $_SESSION['constructions']); if ($form_state->has(['thing', 'changed'])) { - drupal_set_message("The thing has been changed."); + $this->messenger()->addStatus("The thing has been changed."); } $form_state->setRedirect(''); }