diff --git a/core/modules/block_content/tests/src/Functional/BlockContentTranslationUITest.php b/core/modules/block_content/tests/src/Functional/BlockContentTranslationUITest.php
index c200252b81..f0a91fe462 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentTranslationUITest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentTranslationUITest.php
@@ -4,6 +4,7 @@
use Drupal\block_content\Entity\BlockContent;
use Drupal\block_content\Entity\BlockContentType;
+use Drupal\Component\Render\FormattableMarkup;
use Drupal\Component\Utility\Unicode;
use Drupal\Tests\content_translation\Functional\ContentTranslationUITestBase;
@@ -192,12 +193,12 @@ protected function doTestTranslationEdit() {
$url = $entity->urlInfo('edit-form', $options);
$this->drupalGet($url);
- $title = t('Edit @type @title [%language translation]', [
+ $title = new FormattableMarkup('Edit @type @title [%language translation]', [
'@type' => $entity->bundle(),
'@title' => $entity->getTranslation($langcode)->label(),
'%language' => $languages[$langcode]->getName(),
]);
- $this->assertRaw($title);
+ $this->assertRaw((string) $title);
}
}
}
diff --git a/core/modules/shortcut/tests/src/Functional/ShortcutTranslationUITest.php b/core/modules/shortcut/tests/src/Functional/ShortcutTranslationUITest.php
index a1e01e64e5..6afd1d6012 100644
--- a/core/modules/shortcut/tests/src/Functional/ShortcutTranslationUITest.php
+++ b/core/modules/shortcut/tests/src/Functional/ShortcutTranslationUITest.php
@@ -2,9 +2,10 @@
namespace Drupal\Tests\shortcut\Functional;
-use Drupal\Tests\content_translation\Functional\ContentTranslationUITestBase;
+use Drupal\Component\Render\FormattableMarkup;
use Drupal\Core\Entity\EntityChangedInterface;
use Drupal\Core\Language\Language;
+use Drupal\Tests\content_translation\Functional\ContentTranslationUITestBase;
/**
* Tests the shortcut translation UI.
@@ -100,11 +101,11 @@ protected function doTestTranslationEdit() {
$url = $entity->urlInfo('edit-form', $options);
$this->drupalGet($url);
- $title = t('@title [%language translation]', [
+ $title = new FormattableMarkup('@title [%language translation]', [
'@title' => $entity->getTranslation($langcode)->label(),
'%language' => $languages[$langcode]->getName(),
]);
- $this->assertRaw($title);
+ $this->assertRaw((string) $title);
}
}
}