summaryrefslogtreecommitdiffstats
path: root/core/modules/system/tests/modules/form_test/src/Form/FormTestStorageForm.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/system/tests/modules/form_test/src/Form/FormTestStorageForm.php')
-rw-r--r--core/modules/system/tests/modules/form_test/src/Form/FormTestStorageForm.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestStorageForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestStorageForm.php
index f81658d..5cc09b7 100644
--- a/core/modules/system/tests/modules/form_test/src/Form/FormTestStorageForm.php
+++ b/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('<front>');
}