Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / block / tests / modules / block_test / src / Form / FavoriteAnimalTestForm.php
index 3ad55edff2c1cfe76ac56f44f64907b28d683b5d..d262f445df599d701b5f358da687863e2ab11c0c 100644 (file)
@@ -25,7 +25,7 @@ class FavoriteAnimalTestForm extends FormBase {
   public function buildForm(array $form, FormStateInterface $form_state) {
     $form['favorite_animal'] = [
       '#type' => 'textfield',
-      '#title' => $this->t('Your favorite animal.')
+      '#title' => $this->t('Your favorite animal.'),
     ];
 
     $form['submit_animal'] = [
@@ -40,7 +40,7 @@ class FavoriteAnimalTestForm extends FormBase {
    * {@inheritdoc}
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
-    drupal_set_message($this->t('Your favorite animal is: @favorite_animal', ['@favorite_animal' => $form['favorite_animal']['#value']]));
+    $this->messenger()->addStatus($this->t('Your favorite animal is: @favorite_animal', ['@favorite_animal' => $form['favorite_animal']['#value']]));
   }
 
 }