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 / FormTestControllerObject.php
index 40d474d7aa1c8710c6b9d1801ed7dc4bbe96be84..428e9cef35f0216fb1327668dda703dcffb475ff 100644 (file)
@@ -32,7 +32,7 @@ class FormTestControllerObject extends ConfigFormBase {
    * {@inheritdoc}
    */
   public static function create(ContainerInterface $container) {
-    drupal_set_message(t('The FormTestControllerObject::create() method was used for this form.'));
+    \Drupal::messenger()->addStatus(t('The FormTestControllerObject::create() method was used for this form.'));
     return new static(
       $container->get('config.factory')
     );
@@ -64,14 +64,14 @@ class FormTestControllerObject extends ConfigFormBase {
    * {@inheritdoc}
    */
   public function validateForm(array &$form, FormStateInterface $form_state) {
-    drupal_set_message($this->t('The FormTestControllerObject::validateForm() method was used for this form.'));
+    $this->messenger()->addStatus($this->t('The FormTestControllerObject::validateForm() method was used for this form.'));
   }
 
   /**
    * {@inheritdoc}
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
-    drupal_set_message($this->t('The FormTestControllerObject::submitForm() method was used for this form.'));
+    $this->messenger()->addStatus($this->t('The FormTestControllerObject::submitForm() method was used for this form.'));
     $this->config('form_test.object')
       ->set('bananas', $form_state->getValue('bananas'))
       ->save();