Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / file / tests / file_test / src / Form / FileTestForm.php
index f43e20a8e900d13d2f5c04388e5d5357848cb2ab..42a5dd9280ecc718f9bc4394c7799b21471d4634 100644 (file)
@@ -108,13 +108,13 @@ class FileTestForm implements FormInterface {
     $file = file_save_upload('file_test_upload', $validators, $destination, 0, $form_state->getValue('file_test_replace'));
     if ($file) {
       $form_state->setValue('file_test_upload', $file);
-      drupal_set_message(t('File @filepath was uploaded.', ['@filepath' => $file->getFileUri()]));
-      drupal_set_message(t('File name is @filename.', ['@filename' => $file->getFilename()]));
-      drupal_set_message(t('File MIME type is @mimetype.', ['@mimetype' => $file->getMimeType()]));
-      drupal_set_message(t('You WIN!'));
+      \Drupal::messenger()->addStatus(t('File @filepath was uploaded.', ['@filepath' => $file->getFileUri()]));
+      \Drupal::messenger()->addStatus(t('File name is @filename.', ['@filename' => $file->getFilename()]));
+      \Drupal::messenger()->addStatus(t('File MIME type is @mimetype.', ['@mimetype' => $file->getMimeType()]));
+      \Drupal::messenger()->addStatus(t('You WIN!'));
     }
     elseif ($file === FALSE) {
-      drupal_set_message(t('Epic upload FAIL!'), 'error');
+      \Drupal::messenger()->addError(t('Epic upload FAIL!'));
     }
   }