diff --git a/js/history_api.js b/js/history_api.js
index 04b8d5b..61d3041 100644
--- a/js/history_api.js
+++ b/js/history_api.js
@@ -38,13 +38,13 @@ Drupal.history = {};
   window.addEventListener('load', function () {
     // The timeout ensures that popstate-events will be unblocked right
     // after the load event occured, but not in the same event-loop cycle.
-    window.setTimeout(function () { blockPopstateEvent = false; }, 0);
-  }, false);
+    window.setTimeout(function () { blockPopstateEvent = FALSE; }, 0);
+  }, FALSE);
 
   window.addEventListener('popstate', function (evt) {
     if (blockPopstateEvent && document.readyState === 'complete') {
       evt.preventDefault();
       evt.stopImmediatePropagation();
     }
-  }, false);
+  }, FALSE);
 }(window));
diff --git a/js/private_message_inbox_block.js b/js/private_message_inbox_block.js
index 307e1b7..4563073 100644
--- a/js/private_message_inbox_block.js
+++ b/js/private_message_inbox_block.js
@@ -23,9 +23,9 @@ Drupal.PrivateMessageInbox.updateInbox = {};
   function triggerCommands(data) {
     var ajaxObject = Drupal.ajax({
       url: '',
-      base: false,
-      element: false,
-      progress: false
+      base: FALSE,
+      element: FALSE,
+      progress: FALSE
     });
 
     // Trigger any any ajax commands in the response.
@@ -37,7 +37,7 @@ Drupal.PrivateMessageInbox.updateInbox = {};
    */
   function updateInbox() {
     if (!loadingNew) {
-      loadingNew = true;
+      loadingNew = TRUE;
 
       var ids = {};
       container.find('.private-message-thread-inbox').each(function () {
@@ -49,7 +49,7 @@ Drupal.PrivateMessageInbox.updateInbox = {};
         method: 'POST',
         data: {ids: ids},
         success: function (data) {
-          loadingNew = false;
+          loadingNew = FALSE;
           triggerCommands(data);
           if (updateInterval) {
             window.setTimeout(updateInbox, updateInterval);
@@ -118,7 +118,7 @@ Drupal.PrivateMessageInbox.updateInbox = {};
     e.preventDefault();
 
     if (!loadingPrev) {
-      loadingPrev = true;
+      loadingPrev = TRUE;
 
       var oldestTimestamp;
       container.find('.private-message-thread').each(function () {
@@ -131,7 +131,7 @@ Drupal.PrivateMessageInbox.updateInbox = {};
         url: drupalSettings.privateMessageInboxBlock.loadPrevUrl,
         data: {timestamp: oldestTimestamp, count: drupalSettings.privateMessageInboxBlock.threadCount},
         success: function (data) {
-          loadingPrev = false;
+          loadingPrev = FALSE;
           triggerCommands(data);
         }
       });
@@ -177,7 +177,7 @@ Drupal.PrivateMessageInbox.updateInbox = {};
    */
   function init() {
     if (!initialized) {
-      initialized = true;
+      initialized = TRUE;
       container = $('.block-private-message-inbox-block .private-message-thread--full-container');
       if (drupalSettings.privateMessageInboxBlock.totalThreads > drupalSettings.privateMessageInboxBlock.itemsToShow) {
         $('<div/>', {id: 'load-previous-threads-button-wrapper'}).append($('<a/>', {href: '#', id: 'load-previous-threads-button'}).text(Drupal.t('Load Previous'))).insertAfter(container);
diff --git a/js/private_message_members_widget.js b/js/private_message_members_widget.js
index 23fcd47..c0a05b1 100644
--- a/js/private_message_members_widget.js
+++ b/js/private_message_members_widget.js
@@ -24,9 +24,9 @@
   function triggerCommands(data) {
     var ajaxObject = Drupal.ajax({
       url: '',
-      base: false,
-      element: false,
-      progress: false
+      base: FALSE,
+      element: FALSE,
+      progress: FALSE
     });
 
     // Trigger any any ajax commands in the response.
@@ -93,7 +93,7 @@
     if (username.length && !insertedUsernames[username]) {
       // Store a reference to the username so that it cannot be entered into the
       // list again.
-      insertedUsernames[username] = true;
+      insertedUsernames[username] = TRUE;
 
       // Insert a textual representation of the username for users to see and
       // click to remove if necessary.
@@ -106,14 +106,14 @@
         trimmedVal = $.trim($(this).val());
         if (trimmedVal === '') {
           $(this).val(username);
-          found = true;
+          found = TRUE;
         }
         else if (trimmedVal === username) {
-          found = true;
+          found = TRUE;
         }
 
         if (found) {
-          return false;
+          return FALSE;
         }
       });
 
@@ -170,7 +170,7 @@
     if (autocompleteResultsContainer) {
       Drupal.detachBehaviors(autocompleteResultsContainer[0]);
       autocompleteResultsContainer.remove();
-      autocompleteResultsContainer = null;
+      autocompleteResultsContainer = NULL;
     }
   }
 
@@ -241,7 +241,7 @@
         if (keyCode === 9) {
           if (usernameInput.val().length) {
             e.preventDefault();
-            addUserToMembers(usernameInput.val(), true);
+            addUserToMembers(usernameInput.val(), TRUE);
             usernameInput.val('');
             hideAutocompleteResults();
           }
@@ -305,7 +305,7 @@
         // entered text is added to the list of users.
         usernameInputTimeout = window.setTimeout(function () {
           if (usernameInput.val().length) {
-            addUserToMembers(usernameInput.val(), true);
+            addUserToMembers(usernameInput.val(), TRUE);
             usernameInput.val('');
           }
           hideAutocompleteResults();
@@ -462,7 +462,7 @@
   function init() {
     // This should only happen a single time.
     if (!initialized) {
-      initialized = true;
+      initialized = TRUE;
 
       var label;
 
@@ -497,7 +497,7 @@
       inputWrapper.find('input[type="text"]').each(function () {
         var username = $(this).val();
         if (username.length) {
-          addUserToMembers(username, true);
+          addUserToMembers(username, TRUE);
         }
       });
 
diff --git a/js/private_message_notification_block.js b/js/private_message_notification_block.js
index 848342b..e7ed8b3 100644
--- a/js/private_message_notification_block.js
+++ b/js/private_message_notification_block.js
@@ -21,9 +21,9 @@ Drupal.PrivateMessageNotificationBlock = {};
   function triggerCommands(data) {
     var ajaxObject = Drupal.ajax({
       url: '',
-      base: false,
-      element: false,
-      progress: false
+      base: FALSE,
+      element: FALSE,
+      progress: FALSE
     });
 
     // Trigger any any ajax commands in the response.
@@ -74,14 +74,14 @@ Drupal.PrivateMessageNotificationBlock = {};
    */
   function getUnreadThreadCount() {
     if (!checkingCount) {
-      checkingCount = true;
+      checkingCount = TRUE;
 
       $.ajax({
         url: drupalSettings.privateMessageNotificationBlock.newMessageCountCallback,
         success: function (data) {
           triggerCommands(data);
 
-          checkingCount = false;
+          checkingCount = FALSE;
           if (refreshRate) {
             window.setTimeout(getUnreadThreadCount, refreshRate);
           }
@@ -99,7 +99,7 @@ Drupal.PrivateMessageNotificationBlock = {};
    */
   function init() {
     if (!initialized) {
-      initialized = true;
+      initialized = TRUE;
 
       if (drupalSettings.privateMessageNotificationBlock.ajaxRefreshRate) {
         refreshRate = drupalSettings.privateMessageNotificationBlock.ajaxRefreshRate * 1000;
diff --git a/js/private_message_thread.js b/js/private_message_thread.js
index bc76867..27c967f 100644
--- a/js/private_message_thread.js
+++ b/js/private_message_thread.js
@@ -29,9 +29,9 @@ Drupal.PrivateMessages.threadChange = {};
   function triggerCommands(data) {
     var ajaxObject = Drupal.ajax({
       url: '',
-      base: false,
-      element: false,
-      progress: false
+      base: FALSE,
+      element: FALSE,
+      progress: FALSE
     });
 
     // Trigger any any ajax commands in the response.
@@ -61,7 +61,7 @@ Drupal.PrivateMessages.threadChange = {};
 
     // Ensure that a load isn't already in progress.
     if (!loadingPrev) {
-      loadingPrev = true;
+      loadingPrev = TRUE;
 
       var threadId;
       var oldestId;
@@ -82,7 +82,7 @@ Drupal.PrivateMessages.threadChange = {};
         url: drupalSettings.privateMessageThread.previousMessageCheckUrl,
         data: {threadid: threadId, messageid: oldestId},
         success: function (data) {
-          loadingPrev = false;
+          loadingPrev = FALSE;
           // Trigger the AJAX commands that were returned from the server.
           triggerCommands(data);
         }
@@ -161,7 +161,7 @@ Drupal.PrivateMessages.threadChange = {};
       var threadId;
       var newestId = 0;
 
-      loadingNew = true;
+      loadingNew = TRUE;
 
       // Get the thread ID.
       threadId = threadWrapper.children('.private-message-thread:first').attr('data-thread-id');
@@ -180,7 +180,7 @@ Drupal.PrivateMessages.threadChange = {};
         success: function (data) {
           triggerCommands(data);
 
-          loadingNew = false;
+          loadingNew = FALSE;
 
           if (refreshRate) {
              // Check for new messages again.
@@ -225,7 +225,7 @@ Drupal.PrivateMessages.threadChange = {};
     // Only try loading the thread if a thread isn't already loading, and if the
     // requested thread is not the current thread.
     if (!loadingThread && threadId !== currentThreadId) {
-      loadingThread = true;
+      loadingThread = TRUE;
 
       window.clearTimeout(timeout);
 
@@ -242,7 +242,7 @@ Drupal.PrivateMessages.threadChange = {};
             Drupal.PrivateMessages.setActiveThread(threadId);
           }
 
-          loadingThread = false;
+          loadingThread = FALSE;
 
           timeout = window.setTimeout(getNewMessages, refreshRate);
         }
@@ -268,7 +268,7 @@ Drupal.PrivateMessages.threadChange = {};
     insertPreviousButton(threadWrapper);
 
     if (!initialized) {
-      initialized = true;
+      initialized = TRUE;
 
       // Get the original thread ID on page load.
       originalThreadId = threadWrapper.children('.private-message-thread:first').attr('data-thread-id');
@@ -356,7 +356,7 @@ Drupal.PrivateMessages.threadChange = {};
 
       // Lets other modules trigger the loading of a new thread into the page.
       Drupal.PrivateMessages.loadThread = function (threadId) {
-        loadThread(threadId, true);
+        loadThread(threadId, TRUE);
       };
 
       // Lets other modules trigger a retrieval of new messages from the server.
diff --git a/private_message.theme.inc b/private_message.theme.inc
index 0d92faa..3fd78f0 100644
--- a/private_message.theme.inc
+++ b/private_message.theme.inc
@@ -14,7 +14,14 @@ use Drupal\Core\Url;
 function template_preprocess_private_message_notification_block(&$vars) {
   $vars['notification_image_path'] = base_path() . drupal_get_path('module', 'private_message') . '/images/private-message-notification-icon.png';
   $link_title = $vars['new_message_count'] ? \Drupal::service('string_translation')->formatPlural($vars['new_message_count'], 'You have 1 unread private message', 'You have @count unread private messages') : t('You have no unread private messages');
-  $url = Url::fromRoute('private_message.private_message_page', [], ['attributes' => ['title' => $link_title, 'class' => ['private-message-page-link']]]);
+  $url = Url::fromRoute('private_message.private_message_page', [],
+  [
+    'attributes' => [
+      'title' => $link_title,
+      'class' =>
+  ['private-message-page-link'],
+    ],
+  ]);
   $count = $vars['new_message_count'] > 99 ? '99+' : $vars['new_message_count'];
   $vars['private_message_page_link'] = Link::fromTextAndUrl($count, $url)->toString();
   $vars['unread_notification_class'] = $vars['new_message_count'] ? 'unread-threads' : '';
diff --git a/private_message.tokens.inc b/private_message.tokens.inc
index aff23c8..6d72375 100644
--- a/private_message.tokens.inc
+++ b/private_message.tokens.inc
@@ -106,7 +106,6 @@ function private_message_tokens($type, $tokens, array $data, array $options, Bub
   // Replace private message tokens.
   if ($type == 'private_message' && !empty($data['private_message'])) {
 
-
     /** @var \Drupal\private_message\Entity\PrivateMessageInterface $private_message */
     $private_message = $data['private_message'];
 
diff --git a/src/Entity/Builder/PrivateMessageThreadViewBuilder.php b/src/Entity/Builder/PrivateMessageThreadViewBuilder.php
index e606424..66956a4 100644
--- a/src/Entity/Builder/PrivateMessageThreadViewBuilder.php
+++ b/src/Entity/Builder/PrivateMessageThreadViewBuilder.php
@@ -6,7 +6,6 @@ use Drupal\Core\Cache\Cache;
 use Drupal\Core\Entity\EntityDisplayRepositoryInterface;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityRepositoryInterface;
-use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Entity\EntityViewBuilder;
 use Drupal\Core\Language\LanguageManagerInterface;
@@ -124,7 +123,10 @@ class PrivateMessageThreadViewBuilder extends EntityViewBuilder {
         '#url' => $url,
         '#title' => '',
         '#weight' => 9999,
-        '#attributes' => ['data-thread-id' => $entity->id(), 'class' => ['private-message-inbox-thread-link']],
+        '#attributes' => [
+          'data-thread-id' => $entity->id(),
+          'class' => ['private-message-inbox-thread-link'],
+        ],
       ];
     }
 
diff --git a/src/Entity/Builder/PrivateMessageViewBuilder.php b/src/Entity/Builder/PrivateMessageViewBuilder.php
index 108ba8a..3de35b0 100644
--- a/src/Entity/Builder/PrivateMessageViewBuilder.php
+++ b/src/Entity/Builder/PrivateMessageViewBuilder.php
@@ -5,7 +5,6 @@ namespace Drupal\private_message\Entity\Builder;
 use Drupal\Core\Entity\EntityDisplayRepositoryInterface;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityRepositoryInterface;
-use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Entity\EntityViewBuilder;
 use Drupal\Core\Language\LanguageManagerInterface;
@@ -28,10 +27,10 @@ class PrivateMessageViewBuilder extends EntityViewBuilder {
   /**
    * Constructs a PrivateMessageViewBuilder object.
    *
+   * @param \Drupal\Core\Entity\EntityTypeInterface $entityType
+   *   The entity manager service.
    * @param \Drupal\Core\Entity\EntityRepositoryInterface $entityRepository
    *   The entity repository service.
-   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager
-   *   The entity manager service.
    * @param \Drupal\Core\Language\LanguageManagerInterface $languageManager
    *   The language manager.
    * @param \Drupal\Core\Session\AccountProxyInterface $currentUser
diff --git a/src/Form/PrivateMessageForm.php b/src/Form/PrivateMessageForm.php
index c48b68f..ac56577 100644
--- a/src/Form/PrivateMessageForm.php
+++ b/src/Form/PrivateMessageForm.php
@@ -178,7 +178,6 @@ class PrivateMessageForm extends ContentEntityForm {
   public function buildForm(array $form, FormStateInterface $form_state, PrivateMessageThreadInterface $privateMessageThread = NULL) {
     $form = parent::buildForm($form, $form_state);
 
-
     if ($privateMessageThread) {
       $form_state->set('thread', $privateMessageThread);
       $form['actions']['submit']['#ajax'] = [
@@ -196,7 +195,7 @@ class PrivateMessageForm extends ContentEntityForm {
     else {
       // Create a dummy private message thread form so as to retrieve the
       // members element from it.
-      /** @var PrivateMessageThreadInterface $private_message_thread */
+      /** @var \Drupal\private_message\Entity\PrivateMessageThreadInterface $private_message_thread */
       $private_message_thread = PrivateMessageThread::create();
       $form_copy = $form;
       $form_state_copy = clone($form_state);
diff --git a/src/Mapper/PrivateMessageMapper.php b/src/Mapper/PrivateMessageMapper.php
index b90f31e..3ce6d22 100644
--- a/src/Mapper/PrivateMessageMapper.php
+++ b/src/Mapper/PrivateMessageMapper.php
@@ -201,8 +201,6 @@ class PrivateMessageMapper implements PrivateMessageMapperInterface {
         $count,
         $arguments
       )->fetchCol();
-
-      return $results;
     }
     else {
       return [];
@@ -224,7 +222,10 @@ class PrivateMessageMapper implements PrivateMessageMapperInterface {
       'JOIN {private_messages} AS messages ' .
       'ON messages.id = thread_messages.private_messages_target_id ' .
       'WHERE pm_thread_history.delete_timestamp <= messages.created ';
-    $vars = [':uid' => $this->currentUser->id(), ':history_uid' => $this->currentUser->id()];
+    $vars = [
+      ':uid' => $this->currentUser->id(),
+      ':history_uid' => $this->currentUser->id(),
+    ];
     $order_by = 'ORDER BY thread.updated DESC';
     if (count($existingThreadIds)) {
       $query .= 'AND thread.updated >= (SELECT MIN(updated) FROM {private_message_threads} WHERE id IN (:ids[])) ';
diff --git a/src/Plugin/Field/FieldFormatter/PrivateMessageThreadMemberFormatter.php b/src/Plugin/Field/FieldFormatter/PrivateMessageThreadMemberFormatter.php
index c793da3..b6fc54a 100644
--- a/src/Plugin/Field/FieldFormatter/PrivateMessageThreadMemberFormatter.php
+++ b/src/Plugin/Field/FieldFormatter/PrivateMessageThreadMemberFormatter.php
@@ -277,7 +277,11 @@ class PrivateMessageThreadMemberFormatter extends FormatterBase implements Conta
           if ($this->getSetting('display_type') == 'label') {
             if ($access_profiles) {
               $url = Url::fromRoute('entity.user.canonical', ['user' => $user->id()]);
-              $users[$user->id()] = new FormattableMarkup('<a href=":link">@username</a>', [':link' => $url->toString(), '@username' => $user->getDisplayName()]);
+              $users[$user->id()] = new FormattableMarkup('<a href=":link">@username</a>', [
+                '
+              :link' => $url->toString(),
+                '@username' => $user->getDisplayName(),
+              ]);
             }
             else {
               $users[$user->id()] = $user->getDisplayName();
@@ -306,7 +310,7 @@ class PrivateMessageThreadMemberFormatter extends FormatterBase implements Conta
     $members_prefix = $this->getSetting('members_prefix');
     if (strlen($members_prefix)) {
       $first_separator = $prefix_separator && (count($users) > 0) ? $separator : '';
-      $element['#markup'] .= '<span>' . $this->t($members_prefix) . $first_separator . '</span>';
+      $element['#markup'] .= '<span>' . $members_prefix . $first_separator . '</span>';
     }
 
     $element['#markup'] .= implode($separator, $users);
diff --git a/src/Plugin/Field/FieldFormatter/PrivateMessageThreadMessageFormatter.php b/src/Plugin/Field/FieldFormatter/PrivateMessageThreadMessageFormatter.php
index 427ad57..75dd397 100644
--- a/src/Plugin/Field/FieldFormatter/PrivateMessageThreadMessageFormatter.php
+++ b/src/Plugin/Field/FieldFormatter/PrivateMessageThreadMessageFormatter.php
@@ -313,7 +313,7 @@ class PrivateMessageThreadMessageFormatter extends FormatterBase implements Cont
         'desc' => $this->t('Descending'),
       ];
 
-      return isset($keys[$value]) ? $keys[$value] : $value;
+      return $keys[$value] ?? $value;
     }
 
     return $value;
diff --git a/src/PluginManager/PrivateMessageConfigFormManager.php b/src/PluginManager/PrivateMessageConfigFormManager.php
index 10d58f3..8c93ed9 100644
--- a/src/PluginManager/PrivateMessageConfigFormManager.php
+++ b/src/PluginManager/PrivateMessageConfigFormManager.php
@@ -5,7 +5,6 @@ namespace Drupal\private_message\PluginManager;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Plugin\DefaultPluginManager;
-use Traversable;
 
 /**
  * Plugin Manager to detect PrivateMessageConfigForm plugins.
@@ -22,7 +21,7 @@ class PrivateMessageConfigFormManager extends DefaultPluginManager implements Pr
    * @param \Drupal\Core\Extension\ModuleHandlerInterface $moduleHandler
    *   The module handler service.
    */
-  public function __construct(Traversable $namespaces, CacheBackendInterface $cacheBackend, ModuleHandlerInterface $moduleHandler) {
+  public function __construct(\Traversable $namespaces, CacheBackendInterface $cacheBackend, ModuleHandlerInterface $moduleHandler) {
     parent::__construct('Plugin/PrivateMessageConfigForm', $namespaces, $moduleHandler, 'Drupal\private_message\Plugin\PrivateMessageConfigForm\PrivateMessageConfigFormPluginInterface', 'Drupal\private_message\Annotation\PrivateMessageConfigForm');
 
     $this->alterInfo('private_message_config_form_info');
diff --git a/src/Service/PrivateMessageService.php b/src/Service/PrivateMessageService.php
index 62451ff..b155905 100644
--- a/src/Service/PrivateMessageService.php
+++ b/src/Service/PrivateMessageService.php
@@ -15,12 +15,13 @@ use Drupal\private_message\Entity\PrivateMessageThreadInterface;
 use Drupal\private_message\Mapper\PrivateMessageMapperInterface;
 use Drupal\user\UserDataInterface;
 use Drupal\user\UserInterface;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
 
 /**
  * The Private Message service for the private message module.
  */
 class PrivateMessageService implements PrivateMessageServiceInterface {
-
+  use StringTranslationTrait;
   /**
    * The private message mapper service.
    *
@@ -353,7 +354,7 @@ class PrivateMessageService implements PrivateMessageServiceInterface {
             $build['private_message_link'] = [
               '#type' => 'link',
               '#url' => $url,
-              '#title' => t('Send private message'),
+              '#title' => $this->t('Send private message'),
               '#prefix' => '<div class="private_message_link_wrapper">',
               '#suffix' => '</div>',
             ];
@@ -363,7 +364,7 @@ class PrivateMessageService implements PrivateMessageServiceInterface {
             $build['private_message_link'] = [
               '#type' => 'link',
               '#url' => $url,
-              '#title' => t('Send private message'),
+              '#title' => $this->t('Send private message'),
               '#prefix' => '<div class="private_message_link_wrapper">',
               '#suffix' => '</div>',
             ];
@@ -375,7 +376,7 @@ class PrivateMessageService implements PrivateMessageServiceInterface {
         $build['private_message_link'] = [
           '#type' => 'link',
           '#url' => $url,
-          '#title' => t('Send private message'),
+          '#title' => $this->t('Send private message'),
           '#prefix' => '<div class="private_message_link_wrapper">',
           '#suffix' => '</div>',
         ];
diff --git a/src/Service/PrivateMessageThreadManager.php b/src/Service/PrivateMessageThreadManager.php
index c8377e3..358afa1 100644
--- a/src/Service/PrivateMessageThreadManager.php
+++ b/src/Service/PrivateMessageThreadManager.php
@@ -80,9 +80,9 @@ class PrivateMessageThreadManager implements PrivateMessageThreadManagerInterfac
     $this->recipients = $recipients;
     $this->excludeFromNotification = $excludeFromNotification;
 
-    $this->getThread()
-      ->addMessage()
-      ->sendNotification();
+    $this->getThread();
+    $this->addMessage();
+    $this->sendNotification();
   }
 
   /**
diff --git a/tests/src/Functional/PrivateMessageSettingsFormTest.php b/tests/src/Functional/PrivateMessageSettingsFormTest.php
index d852acf..5275c4b 100644
--- a/tests/src/Functional/PrivateMessageSettingsFormTest.php
+++ b/tests/src/Functional/PrivateMessageSettingsFormTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\private_message\Functional;
 
 use Drupal\Tests\BrowserTestBase;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
 
 /**
  * Tests for the Lorem Ipsum module.
@@ -10,6 +11,7 @@ use Drupal\Tests\BrowserTestBase;
  * @group private_message
  */
 class PrivateMessageSettingsFormTest extends BrowserTestBase {
+  use StringTranslationTrait;
   /**
    * {@inheritdoc}
    */
@@ -70,7 +72,7 @@ class PrivateMessageSettingsFormTest extends BrowserTestBase {
     $this->assertResponse(200);
 
     // Test form submission.
-    $this->drupalPostForm(NULL, [], t('Save configuration'));
+    $this->drupalPostForm(NULL, [], $this->t('Save configuration'));
     $this->assertText(
       'The configuration options have been saved.'
     );
