Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / system / tests / modules / form_test / src / Form / FormTestClickedButtonForm.php
index e95244c478d344301ca90a697d5e0247cccbeffe..b54770804375f967a06e3ab736c369012e857ee3 100644 (file)
@@ -83,10 +83,10 @@ class FormTestClickedButtonForm extends FormBase {
    */
   public function validateForm(array &$form, FormStateInterface $form_state) {
     if ($triggering_element = $form_state->getTriggeringElement()) {
-      drupal_set_message(t('The clicked button is %name.', ['%name' => $triggering_element['#name']]));
+      $this->messenger()->addStatus(t('The clicked button is %name.', ['%name' => $triggering_element['#name']]));
     }
     else {
-      drupal_set_message('There is no clicked button.');
+      $this->messenger()->addStatus('There is no clicked button.');
     }
   }
 
@@ -94,7 +94,7 @@ class FormTestClickedButtonForm extends FormBase {
    * {@inheritdoc}
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
-    drupal_set_message('Submit handler for form_test_clicked_button executed.');
+    $this->messenger()->addStatus('Submit handler for form_test_clicked_button executed.');
   }
 
 }