diff --git a/src/Core/ExecutablePluginTrait.php b/src/Core/ExecutablePluginTrait.php
index d0c5c17..ee51a1d 100644
--- a/src/Core/ExecutablePluginTrait.php
+++ b/src/Core/ExecutablePluginTrait.php
@@ -24,7 +24,7 @@ trait ExecutablePluginTrait {
       throw new InvalidPluginDefinitionException('The label is not defined for plugin ' . $this->getPluginId() . ' (' . __CLASS__ . ').');
     }
     // The label can be an instance of
-    // \Drupal\Core\StringTranslation\TranslationWrapper here, so make sure to
+    // \Drupal\Core\StringTranslation\TranslatableMarkup here, so make sure to
     // always return a primitive string representation here.
     return (string) $definition['label'];
   }
diff --git a/tests/src/Functional/TempStorageTest.php b/tests/src/Functional/TempStorageTest.php
index 3175462..6eed5f8 100644
--- a/tests/src/Functional/TempStorageTest.php
+++ b/tests/src/Functional/TempStorageTest.php
@@ -53,27 +53,27 @@ class TempStorageTest extends RulesBrowserTestBase {
     $this->drupalLogin($account_2);
 
     $this->drupalGet('admin/config/workflow/rules/reactions/edit/test_rule');
-    $this->assertSession()->pageTextContains('This rule is being edited by user ' . $account_1->getUsername() . ', and is therefore locked from editing by others.');
+    $this->assertSession()->pageTextContains('This rule is being edited by user ' . $account_1->getDisplayName() . ', and is therefore locked from editing by others.');
 
     $this->pressButton('Cancel');
     $this->assertSession()->pageTextNotContains('Canceled.');
-    $this->assertSession()->pageTextContains('This rule is being edited by user ' . $account_1->getUsername() . ', and is therefore locked from editing by others.');
+    $this->assertSession()->pageTextContains('This rule is being edited by user ' . $account_1->getDisplayName() . ', and is therefore locked from editing by others.');
 
     $this->pressButton('Save');
     $this->assertSession()->pageTextNotContains('Reaction rule Test rule has been updated.');
-    $this->assertSession()->pageTextContains('This rule is being edited by user ' . $account_1->getUsername() . ', and is therefore locked from editing by others.');
+    $this->assertSession()->pageTextContains('This rule is being edited by user ' . $account_1->getDisplayName() . ', and is therefore locked from editing by others.');
 
     $this->clickLink('Edit');
     $current_url = $this->getSession()->getCurrentUrl();
     $this->pressButton('Save');
 
     $this->assertEquals($current_url, $this->getSession()->getCurrentUrl());
-    $this->assertSession()->pageTextContains('This rule is being edited by user ' . $account_1->getUsername() . ', and is therefore locked from editing by others.');
+    $this->assertSession()->pageTextContains('This rule is being edited by user ' . $account_1->getDisplayName() . ', and is therefore locked from editing by others.');
 
     // Try breaking the lock to edit the rule.
     $this->clickLink('break this lock');
 
-    $this->assertSession()->pageTextContains('By breaking this lock, any unsaved changes made by ' . $account_1->getUsername() . ' will be lost.');
+    $this->assertSession()->pageTextContains('By breaking this lock, any unsaved changes made by ' . $account_1->getDisplayName() . ' will be lost.');
     $this->pressButton('Break lock');
 
     $this->assertSession()->pageTextContains('The lock has been broken and you may now edit this rule.');
diff --git a/tests/src/Unit/RulesActionBaseTest.php b/tests/src/Unit/RulesActionBaseTest.php
index eb59a76..c315edc 100644
--- a/tests/src/Unit/RulesActionBaseTest.php
+++ b/tests/src/Unit/RulesActionBaseTest.php
@@ -2,7 +2,7 @@
 
 namespace Drupal\Tests\rules\Unit;
 
-use Drupal\Core\StringTranslation\TranslationWrapper;
+use Drupal\Core\StringTranslation\TranslatableMarkup;
 use Drupal\rules\Core\RulesActionBase;
 
 /**
@@ -46,7 +46,7 @@ class RulesActionBaseTest extends RulesUnitTestBase {
    * @covers ::summary
    */
   public function testTranslatedLabel() {
-    $translation_wrapper = $this->prophesize(TranslationWrapper::class);
+    $translation_wrapper = $this->prophesize(TranslatableMarkup::class);
     $translation_wrapper->__toString()->willReturn('something');
     $rules_action_base = $this->getMockForAbstractClass(
       RulesActionBase::class,
