Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / tests / Drupal / KernelTests / Core / Form / FormValidationMessageOrderTest.php
index 1d20340819ea50e91c4388f4f999fd7ec8b9db1f..6755fd53d89ab2c3efec2caf8b469a63bbeea470 100644 (file)
@@ -8,7 +8,7 @@ use Drupal\Core\Form\FormStateInterface;
 use Drupal\KernelTests\KernelTestBase;
 
 /**
- * Tests form validation mesages are displayed in the same order as the fields.
+ * Tests form validation messages are displayed in the same order as the fields.
  *
  * @group Form
  */
@@ -80,7 +80,8 @@ class FormValidationMessageOrderTest extends KernelTestBase implements FormInter
     $form_builder = $this->container->get('form_builder');
     $form_builder->submitForm($this, $form_state);
 
-    $messages = drupal_get_messages();
+    $messages = \Drupal::messenger()->all();
+    \Drupal::messenger()->deleteAll();
     $this->assertTrue(isset($messages['error']));
     $error_messages = $messages['error'];
     $this->assertEqual($error_messages[0], 'Three field is required.');