diff --git a/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php b/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php
index f844cb9305..ef0c0ee05e 100644
--- a/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php
+++ b/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php
@@ -2,7 +2,6 @@
 
 namespace Drupal\Tests\basic_auth\Functional;
 
-use Drupal\Component\Utility\SafeMarkup;
 use Drupal\Core\Url;
 use Drupal\Tests\basic_auth\Traits\BasicAuthTestTrait;
 use Drupal\language\Entity\ConfigurableLanguage;
@@ -50,7 +49,7 @@ public function testBasicAuth() {
     $this->mink->resetSessions();
 
     $this->drupalGet($url);
-    $this->assertEqual($this->drupalGetHeader('WWW-Authenticate'), SafeMarkup::format('Basic realm="@realm"', ['@realm' => \Drupal::config('system.site')->get('name')]));
+    $this->assertEqual($this->drupalGetHeader('WWW-Authenticate'), 'Basic realm="' . \Drupal::config('system.site')->get('name') . '"');
     $this->assertResponse('401', 'Not authenticated on the route that allows only basic_auth. Prompt to authenticate received.');
 
     $this->drupalGet('admin');
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php b/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php
index 0f89b86e6a..6a2d303b5a 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php
@@ -54,10 +54,7 @@ public function testBlockContentCreation() {
     $this->drupalPostForm('block/add/basic', $edit, t('Save'));
 
     // Check that the Basic block has been created.
-    $this->assertRaw(format_string('@block %name has been created.', [
-      '@block' => 'basic',
-      '%name' => $edit['info[0][value]']
-    ]), 'Basic block created.');
+    $this->assertRaw('basic <em class="placeholder">' . $edit['info[0][value]'] . '</em> has been created.', 'Basic block created.');
 
     // Check that the view mode setting is hidden because only one exists.
     $this->assertNoFieldByXPath('//select[@name="settings[view_mode]"]', NULL, 'View mode setting hidden because only one exists');
@@ -74,9 +71,7 @@ public function testBlockContentCreation() {
     $this->drupalPostForm('block/add/basic', $edit, t('Save'));
 
     // Check that the Basic block has been created.
-    $this->assertRaw(format_string('A custom block with block description %value already exists.', [
-      '%value' => $edit['info[0][value]']
-    ]));
+    $this->assertRaw('A custom block with block description <em class="placeholder">' . $edit['info[0][value]'] . '</em> already exists.');
     $this->assertResponse(200);
   }
 
@@ -103,10 +98,7 @@ public function testBlockContentCreationMultipleViewModes() {
     $this->drupalPostForm('block/add/basic', $edit, t('Save'));
 
     // Check that the Basic block has been created.
-    $this->assertRaw(format_string('@block %name has been created.', [
-      '@block' => 'basic',
-      '%name' => $edit['info[0][value]']
-    ]), 'Basic block created.');
+    $this->assertRaw('basic <em class="placeholder">' . $edit['info[0][value]'] . '</em> has been created.', 'Basic block created.');
 
     // Save our block permanently
     $this->drupalPostForm(NULL, ['region' => 'content'], t('Save block'));
@@ -156,9 +148,7 @@ public function testBlockContentCreationMultipleViewModes() {
     $this->drupalPostForm('block/add/basic', $edit, t('Save'));
 
     // Check that the Basic block has been created.
-    $this->assertRaw(format_string('A custom block with block description %value already exists.', [
-      '%value' => $edit['info[0][value]']
-    ]));
+    $this->assertRaw('A custom block with block description <em class="placeholder">' . $edit['info[0][value]'] . '</em> already exists.');
     $this->assertResponse(200);
   }
 
@@ -176,10 +166,7 @@ public function testDefaultBlockContentCreation() {
     $this->drupalPostForm('block/add', $edit, t('Save'));
 
     // Check that the block has been created and that it is a basic block.
-    $this->assertRaw(format_string('@block %name has been created.', [
-      '@block' => 'basic',
-      '%name' => $edit['info[0][value]'],
-    ]), 'Basic block created.');
+    $this->assertRaw('basic <em class="placeholder">' . $edit['info[0][value]'] . '</em> has been created.', 'Basic block created.');
 
     // Check that the block exists in the database.
     $blocks = \Drupal::entityTypeManager()
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentTypeTest.php b/core/modules/block_content/tests/src/Functional/BlockContentTypeTest.php
index 8105d3fd00..2de5eb36fd 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentTypeTest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentTypeTest.php
@@ -115,7 +115,7 @@ public function testBlockContentTypeEditing() {
       'label' => 'Bar',
     ];
     $this->drupalGet('admin/structure/block/block-content/manage/basic');
-    $this->assertTitle(format_string('Edit @type custom block type | Drupal', ['@type' => 'basic']));
+    $this->assertTitle('Edit basic custom block type | Drupal');
     $this->drupalPostForm(NULL, $edit, t('Save'));
     $front_page_path = Url::fromRoute('<front>')->toString();
     $this->assertBreadcrumb('admin/structure/block/block-content/manage/basic/fields', [
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentValidationTest.php b/core/modules/block_content/tests/src/Functional/BlockContentValidationTest.php
index bfa84082c1..ad2f1f2313 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentValidationTest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentValidationTest.php
@@ -32,9 +32,7 @@ public function testValidation() {
     // Make sure the violation is on the info property
     $this->assertEqual($violations[0]->getPropertyPath(), 'info');
     // Make sure the message is correct.
-    $this->assertEqual($violations[0]->getMessage(), format_string('A custom block with block description %value already exists.', [
-      '%value' => $block->label(),
-    ]));
+    $this->assertEqual($violations[0]->getMessage(), 'A custom block with block description <em class="placeholder">' . $block->label() . '</em> already exists.');
   }
 
 }
diff --git a/core/modules/block_content/tests/src/Functional/PageEditTest.php b/core/modules/block_content/tests/src/Functional/PageEditTest.php
index 41638bd2bc..e4522c92b9 100644
--- a/core/modules/block_content/tests/src/Functional/PageEditTest.php
+++ b/core/modules/block_content/tests/src/Functional/PageEditTest.php
@@ -65,7 +65,7 @@ public function testPageEdit() {
     // Test deleting the block.
     $this->drupalGet("block/" . $revised_block->id());
     $this->clickLink(t('Delete'));
-    $this->assertText(format_string('Are you sure you want to delete the custom block @label?', ['@label' => $revised_block->label()]));
+    $this->assertText("Are you sure you want to delete the custom block {$revised_block->label()}?");
   }
 
 }
diff --git a/core/modules/book/tests/src/Functional/BookTest.php b/core/modules/book/tests/src/Functional/BookTest.php
index d02dfd50d9..07444f9b2d 100644
--- a/core/modules/book/tests/src/Functional/BookTest.php
+++ b/core/modules/book/tests/src/Functional/BookTest.php
@@ -183,6 +183,150 @@ public function testBook() {
     $book->save();
   }
 
+  /**
+   * Checks the outline of sub-pages; previous, up, and next.
+   *
+   * Also checks the printer friendly version of the outline.
+   *
+   * @param \Drupal\Core\Entity\EntityInterface $node
+   *   Node to check.
+   * @param $nodes
+   *   Nodes that should be in outline.
+   * @param $previous
+   *   (optional) Previous link node. Defaults to FALSE.
+   * @param $up
+   *   (optional) Up link node. Defaults to FALSE.
+   * @param $next
+   *   (optional) Next link node. Defaults to FALSE.
+   * @param array $breadcrumb
+   *   The nodes that should be displayed in the breadcrumb.
+   */
+  public function checkBookNode(EntityInterface $node, $nodes, $previous = FALSE, $up = FALSE, $next = FALSE, array $breadcrumb) {
+    // $number does not use drupal_static as it should not be reset
+    // since it uniquely identifies each call to checkBookNode().
+    static $number = 0;
+    $this->drupalGet('node/' . $node->id());
+
+    // Check outline structure.
+    if ($nodes !== NULL) {
+      $this->assertPattern($this->generateOutlinePattern($nodes), format_string('Node @number outline confirmed.', ['@number' => $number]));
+    }
+    else {
+      $this->pass(format_string('Node %number does not have outline.', ['%number' => $number]));
+    }
+
+    // Check previous, up, and next links.
+    if ($previous) {
+      /** @var \Drupal\Core\Url $url */
+      $url = $previous->urlInfo();
+      $url->setOptions(['attributes' => ['rel' => ['prev'], 'title' => t('Go to previous page')]]);
+      $unrendered_text = ['#markup' => '<b>‹</b> ' . $previous->label()];
+      $rendered_text = \Drupal::service('renderer')->renderRoot($unrendered_text);
+      $this->assertRaw(\Drupal::l($rendered_text, $url), 'Previous page link found.');
+    }
+
+    if ($up) {
+      /** @var \Drupal\Core\Url $url */
+      $url = $up->urlInfo();
+      $url->setOptions(['attributes' => ['title' => t('Go to parent page')]]);
+      $this->assertRaw(\Drupal::l('Up', $url), 'Up page link found.');
+    }
+
+    if ($next) {
+      /** @var \Drupal\Core\Url $url */
+      $url = $next->urlInfo();
+      $url->setOptions(['attributes' => ['rel' => ['next'], 'title' => t('Go to next page')]]);
+      $unrendered_text = ['#markup' => $next->label() . ' <b>›</b>'];
+      $rendered_text = \Drupal::service('renderer')->renderRoot($unrendered_text);
+      $this->assertRaw(\Drupal::l($rendered_text, $url), 'Next page link found.');
+    }
+
+    // Compute the expected breadcrumb.
+    $expected_breadcrumb = [];
+    $expected_breadcrumb[] = \Drupal::url('<front>');
+    foreach ($breadcrumb as $a_node) {
+      $expected_breadcrumb[] = $a_node->url();
+    }
+
+    // Fetch links in the current breadcrumb.
+    $links = $this->xpath('//nav[@class="breadcrumb"]/ol/li/a');
+    $got_breadcrumb = [];
+    foreach ($links as $link) {
+      $got_breadcrumb[] = (string) $link['href'];
+    }
+
+    // Compare expected and got breadcrumbs.
+    $this->assertIdentical($expected_breadcrumb, $got_breadcrumb, 'The breadcrumb is correctly displayed on the page.');
+
+    // Check printer friendly version.
+    $this->drupalGet('book/export/html/' . $node->id());
+    $this->assertText($node->label(), 'Printer friendly title found.');
+    $this->assertRaw($node->body->processed, 'Printer friendly body found.');
+
+    $number++;
+  }
+
+  /**
+   * Creates a regular expression to check for the sub-nodes in the outline.
+   *
+   * @param array $nodes
+   *   An array of nodes to check in outline.
+   *
+   * @return string
+   *   A regular expression that locates sub-nodes of the outline.
+   */
+  public function generateOutlinePattern($nodes) {
+    $outline = '';
+    foreach ($nodes as $node) {
+      $outline .= '(node\/' . $node->id() . ')(.*?)(' . $node->label() . ')(.*?)';
+    }
+
+    return '/<nav id="book-navigation-' . $this->book->id() . '"(.*?)<ul(.*?)' . $outline . '<\/ul>/s';
+  }
+
+  /**
+   * Creates a book node.
+   *
+   * @param int|string $book_nid
+   *   A book node ID or set to 'new' to create a new book.
+   * @param int|null $parent
+   *   (optional) Parent book reference ID. Defaults to NULL.
+   *
+   * @return \Drupal\node\NodeInterface
+   *   The created node.
+   */
+  public function createBookNode($book_nid, $parent = NULL) {
+    // $number does not use drupal_static as it should not be reset
+    // since it uniquely identifies each call to createBookNode().
+    // Used to ensure that when sorted nodes stay in same order.
+    static $number = 0;
+
+    $edit = [];
+    $edit['title[0][value]'] = str_pad($number, 2, '0', STR_PAD_LEFT) . ' - SimpleTest test node ' . $this->randomMachineName(10);
+    $edit['body[0][value]'] = 'SimpleTest test body ' . $this->randomMachineName(32) . ' ' . $this->randomMachineName(32);
+    $edit['book[bid]'] = $book_nid;
+
+    if ($parent !== NULL) {
+      $this->drupalPostForm('node/add/book', $edit, t('Change book (update list of parents)'));
+
+      $edit['book[pid]'] = $parent;
+      $this->drupalPostForm(NULL, $edit, t('Save'));
+      // Make sure the parent was flagged as having children.
+      $parent_node = \Drupal::entityManager()->getStorage('node')->loadUnchanged($parent);
+      $this->assertFalse(empty($parent_node->book['has_children']), 'Parent node is marked as having children');
+    }
+    else {
+      $this->drupalPostForm('node/add/book', $edit, t('Save'));
+    }
+
+    // Check to make sure the book node was created.
+    $node = $this->drupalGetNodeByTitle($edit['title[0][value]']);
+    $this->assertNotNull(($node === FALSE ? NULL : $node), 'Book node found in database.');
+    $number++;
+
+    return $node;
+  }
+
   /**
    * Tests book export ("printer-friendly version") functionality.
    */
diff --git a/core/modules/comment/tests/src/Kernel/CommentFieldAccessTest.php b/core/modules/comment/tests/src/Kernel/CommentFieldAccessTest.php
index 1e0fd72129..cbaab4e1f8 100644
--- a/core/modules/comment/tests/src/Kernel/CommentFieldAccessTest.php
+++ b/core/modules/comment/tests/src/Kernel/CommentFieldAccessTest.php
@@ -211,17 +211,11 @@ public function testAccessToAdministrativeFields() {
       foreach ($permutations as $set) {
         $may_view = $set['comment']->{$field}->access('view', $set['user']);
         $may_update = $set['comment']->{$field}->access('edit', $set['user']);
-        $this->assertTrue($may_view, SafeMarkup::format('User @user can view field @field on comment @comment', [
-          '@user' => $set['user']->getUsername(),
-          '@comment' => $set['comment']->getSubject(),
-          '@field' => $field,
-        ]));
-        $this->assertEqual($may_update, $set['user']->hasPermission('administer comments'), SafeMarkup::format('User @user @state update field @field on comment @comment', [
-          '@user' => $set['user']->getUsername(),
-          '@state' => $may_update ? 'can' : 'cannot',
-          '@comment' => $set['comment']->getSubject(),
-          '@field' => $field,
-        ]));
+        $username = $set['user']->getUsername();
+        $state = $may_update ? 'can' : 'cannot';
+        $comment_subject = $set['comment']->getSubject();
+        $this->assertTrue($may_view, "User $username can view field $field on comment $comment_subject");
+        $this->assertEqual($may_update, $set['user']->hasPermission('administer comments'), "User $username $state update field $field on comment $comment_subject");
       }
     }
 
diff --git a/core/modules/config/tests/src/Functional/ConfigEntityTest.php b/core/modules/config/tests/src/Functional/ConfigEntityTest.php
index 4eb0744f94..40fbbcd334 100644
--- a/core/modules/config/tests/src/Functional/ConfigEntityTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigEntityTest.php
@@ -238,9 +238,9 @@ public function testCRUDUI() {
     $label1 = $this->randomMachineName();
     $label2 = $this->randomMachineName();
     $label3 = $this->randomMachineName();
-    $message_insert = format_string('%label configuration has been created.', ['%label' => $label1]);
-    $message_update = format_string('%label configuration has been updated.', ['%label' => $label2]);
-    $message_delete = format_string('The test configuration %label has been deleted.', ['%label' => $label2]);
+    $message_insert = '<em class="placeholder">' . $label1 . '</em> configuration has been created.';
+    $message_update = '<em class="placeholder">' . $label2 . '</em> configuration has been updated.';
+    $message_delete = 'The test configuration <em class="placeholder">' . $label2 . '</em> has been deleted.';
 
     // Create a configuration entity.
     $edit = [
@@ -311,7 +311,7 @@ public function testCRUDUI() {
     ];
     $this->drupalPostForm('admin/structure/config_test/add', $edit, 'Save');
     $this->assertResponse(200);
-    $message_insert = format_string('%label configuration has been created.', ['%label' => $edit['label']]);
+    $message_insert = '<em class="placeholder">' . $edit['label'] . '</em> configuration has been created.';
     $this->assertRaw($message_insert);
     $this->assertLinkByHref('admin/structure/config_test/manage/0');
     $this->assertLinkByHref('admin/structure/config_test/manage/0/delete');
diff --git a/core/modules/config/tests/src/Functional/ConfigImportUITest.php b/core/modules/config/tests/src/Functional/ConfigImportUITest.php
index fd76990da6..1f6e743b73 100644
--- a/core/modules/config/tests/src/Functional/ConfigImportUITest.php
+++ b/core/modules/config/tests/src/Functional/ConfigImportUITest.php
@@ -3,7 +3,6 @@
 namespace Drupal\Tests\config\Functional;
 
 use Drupal\Component\Utility\Html;
-use Drupal\Component\Utility\SafeMarkup;
 use Drupal\Core\Config\InstallStorage;
 use Drupal\Tests\BrowserTestBase;
 
@@ -292,7 +291,7 @@ public function testImportDiff() {
     // Load the diff UI and verify that the diff reflects the change.
     $this->drupalGet('admin/config/development/configuration/sync/diff/' . $config_name);
     $this->assertNoRaw('&amp;nbsp;');
-    $this->assertTitle(format_string('View changes of @config_name | Drupal', ['@config_name' => $config_name]));
+    $this->assertTitle("View changes of $config_name | Drupal");
 
     // The following assertions do not use $this::assertEscaped() because
     // \Drupal\Component\Diff\DiffFormatter adds markup that signifies what has
@@ -433,7 +432,7 @@ public function testImportErrorLog() {
 
     // Attempt to import configuration and verify that an error message appears.
     $this->drupalPostForm(NULL, [], t('Import all'));
-    $this->assertText(SafeMarkup::format('Deleted and replaced configuration entity "@name"', ['@name' => $name_secondary]));
+    $this->assertText('Deleted and replaced configuration entity "' . @$name_secondary . '"');
     $this->assertText(t('The configuration was imported with errors.'));
     $this->assertNoText(t('The configuration was imported successfully.'));
     $this->assertText(t('There are no configuration changes to import.'));
@@ -453,11 +452,11 @@ public function testEntityBundleDelete() {
     $this->drupalGet('admin/config/development/configuration');
     // The node type, body field and entity displays will be scheduled for
     // removal.
-    $this->assertText(format_string('node.type.@type', ['@type' => $node_type->id()]));
-    $this->assertText(format_string('field.field.node.@type.body', ['@type' => $node_type->id()]));
-    $this->assertText(format_string('core.entity_view_display.node.@type.teaser', ['@type' => $node_type->id()]));
-    $this->assertText(format_string('core.entity_view_display.node.@type.default', ['@type' => $node_type->id()]));
-    $this->assertText(format_string('core.entity_form_display.node.@type.default', ['@type' => $node_type->id()]));
+    $this->assertText("node.type.{$node_type->id()}");
+    $this->assertText("field.field.node.{$node_type->id()}.body");
+    $this->assertText("core.entity_view_display.node.{$node_type->id()}.teaser");
+    $this->assertText("core.entity_view_display.node.{$node_type->id()}.default");
+    $this->assertText("core.entity_form_display.node.{$node_type->id()}.default");
 
     // Attempt to import configuration and verify that an error message appears
     // and the node type, body field and entity displays are still scheduled for
@@ -465,22 +464,22 @@ public function testEntityBundleDelete() {
     $this->drupalPostForm(NULL, [], t('Import all'));
     $validation_message = t('Entities exist of type %entity_type and %bundle_label %bundle. These entities need to be deleted before importing.', ['%entity_type' => $node->getEntityType()->getLabel(), '%bundle_label' => $node->getEntityType()->getBundleLabel(), '%bundle' => $node_type->label()]);
     $this->assertRaw($validation_message);
-    $this->assertText(format_string('node.type.@type', ['@type' => $node_type->id()]));
-    $this->assertText(format_string('field.field.node.@type.body', ['@type' => $node_type->id()]));
-    $this->assertText(format_string('core.entity_view_display.node.@type.teaser', ['@type' => $node_type->id()]));
-    $this->assertText(format_string('core.entity_view_display.node.@type.default', ['@type' => $node_type->id()]));
-    $this->assertText(format_string('core.entity_form_display.node.@type.default', ['@type' => $node_type->id()]));
+    $this->assertText("node.type.{$node_type->id()}");
+    $this->assertText("field.field.node.{$node_type->id()}.body");
+    $this->assertText("core.entity_view_display.node.{$node_type->id()}.teaser");
+    $this->assertText("core.entity_view_display.node.{$node_type->id()}.default");
+    $this->assertText("core.entity_form_display.node.{$node_type->id()}.default");
 
     // Delete the node and try to import again.
     $node->delete();
     $this->drupalPostForm(NULL, [], t('Import all'));
     $this->assertNoRaw($validation_message);
     $this->assertText(t('There are no configuration changes to import.'));
-    $this->assertNoText(format_string('node.type.@type', ['@type' => $node_type->id()]));
-    $this->assertNoText(format_string('field.field.node.@type.body', ['@type' => $node_type->id()]));
-    $this->assertNoText(format_string('core.entity_view_display.node.@type.teaser', ['@type' => $node_type->id()]));
-    $this->assertNoText(format_string('core.entity_view_display.node.@type.default', ['@type' => $node_type->id()]));
-    $this->assertNoText(format_string('core.entity_form_display.node.@type.default', ['@type' => $node_type->id()]));
+    $this->assertNoText("node.type.{$node_type->id()}");
+    $this->assertNoText("field.field.node.{$node_type->id()}.body");
+    $this->assertNoText("core.entity_view_display.node.{$node_type->id()}.teaser");
+    $this->assertNoText("core.entity_view_display.node.{$node_type->id()}.default");
+    $this->assertNoText("core.entity_form_display.node.{$node_type->id()}.default");
   }
 
   /**
diff --git a/core/modules/contact/tests/src/Functional/ContactPersonalTest.php b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php
index 8304d7c7e5..40feaf243a 100644
--- a/core/modules/contact/tests/src/Functional/ContactPersonalTest.php
+++ b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php
@@ -2,7 +2,6 @@
 
 namespace Drupal\Tests\contact\Functional;
 
-use Drupal\Component\Utility\SafeMarkup;
 use Drupal\Component\Render\PlainTextOutput;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\Test\AssertMailTrait;
@@ -95,12 +94,7 @@ public function testSendPersonalContactMessage() {
     $this->drupalLogin($this->adminUser);
     // Verify that the correct watchdog message has been logged.
     $this->drupalGet('/admin/reports/dblog');
-    $placeholders = [
-      '@sender_name' => $this->webUser->username,
-      '@sender_email' => $this->webUser->getEmail(),
-      '@recipient_name' => $this->contactUser->getUsername()
-    ];
-    $this->assertRaw(SafeMarkup::format('@sender_name (@sender_email) sent @recipient_name an email.', $placeholders));
+    $this->assertRaw(htmlspecialchars($this->webUser->getUsername() . ' (' . $this->webUser->getEmail() . ') sent ' . $this->contactUser->getUsername() . ' an email.'));
     // Ensure an unescaped version of the email does not exist anywhere.
     $this->assertNoRaw($this->webUser->getEmail());
   }
diff --git a/core/modules/contact/tests/src/Functional/ContactSitewideTest.php b/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
index 178a3ad01d..66841efaca 100644
--- a/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
+++ b/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
@@ -150,7 +150,7 @@ public function testSiteWideContact() {
     $max_length = EntityTypeInterface::BUNDLE_MAX_LENGTH;
     $max_length_exceeded = $max_length + 1;
     $this->addContactForm($id = Unicode::strtolower($this->randomMachineName($max_length_exceeded)), $label = $this->randomMachineName($max_length_exceeded), implode(',', [$recipients[0]]), '', TRUE);
-    $this->assertText(format_string('Machine-readable name cannot be longer than @max characters but is currently @exceeded characters long.', ['@max' => $max_length, '@exceeded' => $max_length_exceeded]));
+    $this->assertText('Machine-readable name cannot be longer than ' . $max_length . ' characters but is currently ' . $max_length_exceeded . ' characters long.');
     $this->addContactForm($id = Unicode::strtolower($this->randomMachineName($max_length)), $label = $this->randomMachineName($max_length), implode(',', [$recipients[0]]), '', TRUE);
     $this->assertText(t('Contact form @label has been added.', ['@label' => $label]));
 
diff --git a/core/modules/field/src/Tests/Boolean/BooleanFormatterSettingsTest.php b/core/modules/field/src/Tests/Boolean/BooleanFormatterSettingsTest.php
index 92efa9817b..bd88f929a3 100644
--- a/core/modules/field/src/Tests/Boolean/BooleanFormatterSettingsTest.php
+++ b/core/modules/field/src/Tests/Boolean/BooleanFormatterSettingsTest.php
@@ -3,7 +3,6 @@
 namespace Drupal\field\Tests\Boolean;
 
 use Drupal\Component\Utility\Unicode;
-use Drupal\Component\Utility\SafeMarkup;
 use Drupal\field\Entity\FieldConfig;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\simpletest\WebTestBase;
@@ -90,10 +89,6 @@ public function testBooleanFormatterSettings() {
       'Custom',
     ];
 
-    // Define what the "default" option should look like, depending on the
-    // field settings.
-    $default = 'Field settings (@on / @off)';
-
     // For several different values of the field settings, test that the
     // options, including default, are shown correctly.
     $settings = [
@@ -118,7 +113,7 @@ public function testBooleanFormatterSettings() {
       foreach ($options as $string) {
         $this->assertText($string);
       }
-      $this->assertText(SafeMarkup::format($default, ['@on' => $values[0], '@off' => $values[1]]));
+      $this->assertText('Field settings (' . $values[0] . ' / ' . $values[1] . ')');
     }
 
     foreach ($settings as $values) {
diff --git a/core/modules/field/src/Tests/String/StringFieldTest.php b/core/modules/field/src/Tests/String/StringFieldTest.php
index fdedb79907..4078698e5e 100644
--- a/core/modules/field/src/Tests/String/StringFieldTest.php
+++ b/core/modules/field/src/Tests/String/StringFieldTest.php
@@ -79,7 +79,7 @@ public function _testTextfieldWidgets($field_type, $widget_type) {
     $this->drupalGet('entity_test/add');
     $this->assertFieldByName("{$field_name}[0][value]", '', 'Widget is displayed');
     $this->assertNoFieldByName("{$field_name}[0][format]", '1', 'Format selector is not displayed');
-    $this->assertRaw(format_string('placeholder="A placeholder on @widget_type"', ['@widget_type' => $widget_type]));
+    $this->assertRaw('placeholder="A placeholder on ' . $widget_type . '"');
 
     // Submit with some value.
     $value = $this->randomMachineName();
diff --git a/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php b/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php
index f71be314ab..8d310eff67 100644
--- a/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php
+++ b/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php
@@ -156,6 +156,7 @@ public function testTimestampAgoFormatter() {
 
       // Test a timestamp in the past
       $value = $request_time - 87654321;
+      // @todo
       $expected = SafeMarkup::format($past_format, ['@interval' => \Drupal::service('date.formatter')->formatTimeDiffSince($value, ['granularity' => $granularity])]);
 
       $component = $this->display->getComponent($this->fieldName);
@@ -171,6 +172,7 @@ public function testTimestampAgoFormatter() {
 
       // Test a timestamp in the future
       $value = $request_time + 87654321;
+      // @todo
       $expected = SafeMarkup::format($future_format, ['@interval' => \Drupal::service('date.formatter')->formatTimeDiffUntil($value, ['granularity' => $granularity])]);
 
       $component = $this->display->getComponent($this->fieldName);
diff --git a/core/modules/field_ui/src/Tests/ManageFieldsTest.php b/core/modules/field_ui/src/Tests/ManageFieldsTest.php
index 112e3923c4..ec00580ef4 100644
--- a/core/modules/field_ui/src/Tests/ManageFieldsTest.php
+++ b/core/modules/field_ui/src/Tests/ManageFieldsTest.php
@@ -397,7 +397,7 @@ public function testFieldPrefix() {
     // Create a valid field.
     $this->fieldUIAddNewField('admin/structure/types/manage/' . $this->contentType, $this->fieldNameInput, $this->fieldLabel);
     $this->drupalGet('admin/structure/types/manage/' . $this->contentType . '/fields/node.' . $this->contentType . '.' . $field_prefix . $this->fieldNameInput);
-    $this->assertText(format_string('@label settings for @type', ['@label' => $this->fieldLabel, '@type' => $this->contentType]));
+    $this->assertText(htmlspecialchars($this->fieldLabel . ' settings for ' . $this->contentType));
   }
 
   /**
diff --git a/core/modules/file/src/Tests/FilePrivateTest.php b/core/modules/file/src/Tests/FilePrivateTest.php
index 88574cb652..0f20d3d8e5 100644
--- a/core/modules/file/src/Tests/FilePrivateTest.php
+++ b/core/modules/file/src/Tests/FilePrivateTest.php
@@ -87,6 +87,8 @@ public function testPrivateFile() {
     $this->assertUrl('node/' . $new_node->id() . '/edit');
     // Check that we got the expected constraint form error.
     $constraint = new ReferenceAccessConstraint();
+    // The constraint message is a formatted messase, so we have to use
+    // SafeMarkup to evaluate it.
     $this->assertRaw(SafeMarkup::format($constraint->message, ['%type' => 'file', '%id' => $node_file->id()]));
     // Attempt to reuse the existing file when creating a new node, and confirm
     // that access is still denied.
@@ -97,6 +99,8 @@ public function testPrivateFile() {
     $new_node = $this->drupalGetNodeByTitle($edit['title[0][value]']);
     $this->assertTrue(empty($new_node), 'Node was not created.');
     $this->assertUrl('node/add/' . $type_name);
+    // The constraint message is a formatted messase, so we have to use
+    // SafeMarkup to evaluate it.
     $this->assertRaw(SafeMarkup::format($constraint->message, ['%type' => 'file', '%id' => $node_file->id()]));
 
     // Now make file_test_file_download() return everything.
diff --git a/core/modules/image/src/Tests/ImageFieldDisplayTest.php b/core/modules/image/src/Tests/ImageFieldDisplayTest.php
index 05d716c367..b521601e40 100644
--- a/core/modules/image/src/Tests/ImageFieldDisplayTest.php
+++ b/core/modules/image/src/Tests/ImageFieldDisplayTest.php
@@ -317,7 +317,7 @@ public function testImageFieldSettings() {
     $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
     // Add the required alt text.
     $this->drupalPostForm(NULL, [$field_name . '[1][alt]' => $alt], t('Save'));
-    $this->assertText(format_string('Article @title has been updated.', ['@title' => $node->getTitle()]));
+    $this->assertText("Article {$node->getTitle()} has been updated.");
 
     // Assert ImageWidget::process() calls FieldWidget::process().
     $this->drupalGet('node/' . $node->id() . '/edit');
diff --git a/core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php b/core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php
index 194b9b06ce..3559ad6392 100644
--- a/core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php
+++ b/core/modules/node/tests/src/Functional/Views/BulkFormAccessTest.php
@@ -88,6 +88,7 @@ public function testNodeEditAccess() {
       'action' => 'node_unpublish_action',
     ];
     $this->drupalPostForm('test-node-bulk-form', $edit, t('Apply to selected items'));
+    // @todo
     $this->assertRaw(SafeMarkup::format('No access to execute %action on the @entity_type_label %entity_label.', [
       '%action' => 'Unpublish content',
       '@entity_type_label' => 'Content',
diff --git a/core/modules/options/tests/src/Functional/OptionsFieldUITest.php b/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
index ec5874b2e0..14cb02aab3 100644
--- a/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
+++ b/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
@@ -322,7 +322,7 @@ public function testNodeDisplay() {
     ];
 
     $this->drupalPostForm($this->adminPath, $edit, t('Save field settings'));
-    $this->assertText(format_string('Updated field @field_name field settings.', ['@field_name' => $this->fieldName]), "The 'On' and 'Off' form fields work for boolean fields.");
+    $this->assertText('Updated field ' . $this->fieldName . ' field settings.', "The 'On' and 'Off' form fields work for boolean fields.");
 
     // Select a default value.
     $edit = [
diff --git a/core/modules/system/src/Tests/System/AccessDeniedTest.php b/core/modules/system/src/Tests/System/AccessDeniedTest.php
index ba1d599671..2efe7449c7 100644
--- a/core/modules/system/src/Tests/System/AccessDeniedTest.php
+++ b/core/modules/system/src/Tests/System/AccessDeniedTest.php
@@ -56,6 +56,7 @@ public function testAccessDenied() {
       'site_403' => 'user/' . $this->adminUser->id(),
     ];
     $this->drupalPostForm('admin/config/system/site-information', $edit, t('Save configuration'));
+    // @todo
     $this->assertRaw(SafeMarkup::format("The path '%path' has to start with a slash.", ['%path' => $edit['site_403']]));
 
     // Use a custom 403 page.
diff --git a/core/modules/system/src/Tests/System/FrontPageTest.php b/core/modules/system/src/Tests/System/FrontPageTest.php
index e24e90c31c..1752714931 100644
--- a/core/modules/system/src/Tests/System/FrontPageTest.php
+++ b/core/modules/system/src/Tests/System/FrontPageTest.php
@@ -70,6 +70,7 @@ public function testDrupalFrontPage() {
     // Change the front page to a path without a starting slash.
     $edit = ['site_frontpage' => $this->nodePath];
     $this->drupalPostForm('admin/config/system/site-information', $edit, t('Save configuration'));
+    // @todo
     $this->assertRaw(SafeMarkup::format("The path '%path' has to start with a slash.", ['%path' => $edit['site_frontpage']]));
 
     // Change the front page to a valid path.
diff --git a/core/modules/system/src/Tests/System/PageNotFoundTest.php b/core/modules/system/src/Tests/System/PageNotFoundTest.php
index b1a88d827b..9c3650d501 100644
--- a/core/modules/system/src/Tests/System/PageNotFoundTest.php
+++ b/core/modules/system/src/Tests/System/PageNotFoundTest.php
@@ -44,6 +44,7 @@ public function testPageNotFound() {
       'site_404' => 'user/' . $this->adminUser->id(),
     ];
     $this->drupalPostForm('admin/config/system/site-information', $edit, t('Save configuration'));
+    // @todo
     $this->assertRaw(SafeMarkup::format("The path '%path' has to start with a slash.", ['%path' => $edit['site_404']]));
 
     // Use a custom 404 page.
diff --git a/core/modules/system/tests/src/Functional/Entity/EntityOperationsTest.php b/core/modules/system/tests/src/Functional/Entity/EntityOperationsTest.php
index b020f42870..f888c4aa0e 100644
--- a/core/modules/system/tests/src/Functional/Entity/EntityOperationsTest.php
+++ b/core/modules/system/tests/src/Functional/Entity/EntityOperationsTest.php
@@ -36,7 +36,7 @@ public function testEntityOperationAlter() {
     $roles = user_roles();
     foreach ($roles as $role) {
       $this->assertLinkByHref($role->url() . '/test_operation');
-      $this->assertLink(format_string('Test Operation: @label', ['@label' => $role->label()]));
+      $this->assertLink('Test Operation: ' . $role->label());
     }
   }
 
diff --git a/core/modules/user/src/Tests/UserRegistrationTest.php b/core/modules/user/src/Tests/UserRegistrationTest.php
index 128b71b7da..a5f5e53723 100644
--- a/core/modules/user/src/Tests/UserRegistrationTest.php
+++ b/core/modules/user/src/Tests/UserRegistrationTest.php
@@ -273,10 +273,11 @@ public function testUniqueFields() {
 
     $edit = ['mail' => 'test@example.com', 'name' => $account->getUsername()];
     $this->drupalPostForm('user/register', $edit, t('Create new account'));
-    $this->assertRaw(SafeMarkup::format('The username %value is already taken.', ['%value' => $account->getUsername()]));
+    $this->assertRaw('The username <em class="placeholder">' . $account->getUsername() . '</em> is already taken.');
 
     $edit = ['mail' => $account->getEmail(), 'name' => $this->randomString()];
     $this->drupalPostForm('user/register', $edit, t('Create new account'));
+    // @todo
     $this->assertRaw(SafeMarkup::format('The email address %value is already taken.', ['%value' => $account->getEmail()]));
   }
 
diff --git a/core/modules/user/tests/src/Functional/Views/BulkFormAccessTest.php b/core/modules/user/tests/src/Functional/Views/BulkFormAccessTest.php
index 084015eec8..76809ecb9c 100644
--- a/core/modules/user/tests/src/Functional/Views/BulkFormAccessTest.php
+++ b/core/modules/user/tests/src/Functional/Views/BulkFormAccessTest.php
@@ -54,6 +54,7 @@ public function testUserEditAccess() {
     $this->drupalPostForm('test-user-bulk-form', $edit, t('Apply to selected items'));
     $this->assertResponse(200);
 
+    // @todo
     $this->assertRaw(SafeMarkup::format('No access to execute %action on the @entity_type_label %entity_label.', [
       '%action' => 'Block the selected user(s)',
       '@entity_type_label' => 'User',
diff --git a/core/modules/views_ui/tests/src/Functional/HandlerTest.php b/core/modules/views_ui/tests/src/Functional/HandlerTest.php
index 31829941fc..e0b521c2e8 100644
--- a/core/modules/views_ui/tests/src/Functional/HandlerTest.php
+++ b/core/modules/views_ui/tests/src/Functional/HandlerTest.php
@@ -225,7 +225,7 @@ public function testBrokenHandlers() {
       ];
 
       foreach ($original_configuration as $key => $value) {
-        $this->assertText(SafeMarkup::format('@key: @value', ['@key' => $key, '@value' => $value]));
+        $this->assertText("$key: $value");
       }
     }
   }
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php
index 9c1875c85d..f0a8fda9dc 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php
@@ -2,7 +2,6 @@
 
 namespace Drupal\KernelTests\Core\Config;
 
-use Drupal\Component\Utility\SafeMarkup;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Component\Uuid\Php;
 use Drupal\Core\Config\ConfigImporter;
@@ -106,7 +105,7 @@ public function testRenameValidation() {
     catch (ConfigImporterException $e) {
       $this->pass('Expected ConfigImporterException thrown when a renamed configuration entity does not match the existing entity type.');
       $expected = [
-        SafeMarkup::format('Entity type mismatch on rename. @old_type not equal to @new_type for existing configuration @old_name and staged configuration @new_name.', ['@old_type' => 'node_type', '@new_type' => 'config_test', '@old_name' => 'node.type.' . $content_type->id(), '@new_name' => 'config_test.dynamic.' . $test_entity_id])
+        'Entity type mismatch on rename. node_type not equal to config_test for existing configuration node.type.' . $content_type->id() . ' and staged configuration config_test.dynamic.' . $test_entity_id . '.'
       ];
       $this->assertEqual($expected, $this->configImporter->getErrors());
     }
@@ -149,7 +148,7 @@ public function testRenameSimpleConfigValidation() {
     catch (ConfigImporterException $e) {
       $this->pass('Expected ConfigImporterException thrown when simple configuration is renamed.');
       $expected = [
-        SafeMarkup::format('Rename operation for simple configuration. Existing configuration @old_name and staged configuration @new_name.', ['@old_name' => 'config_test.old', '@new_name' => 'config_test.new'])
+        'Rename operation for simple configuration. Existing configuration config_test.old and staged configuration config_test.new.',
       ];
       $this->assertEqual($expected, $this->configImporter->getErrors());
     }
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php
index 4024b7f9d9..e24e67aacb 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php
@@ -3,7 +3,6 @@
 namespace Drupal\KernelTests\Core\Config;
 
 use Drupal\Component\Utility\Html;
-use Drupal\Component\Utility\SafeMarkup;
 use Drupal\Core\Config\ConfigImporter;
 use Drupal\Core\Config\ConfigImporterException;
 use Drupal\Core\Config\StorageComparer;
@@ -245,7 +244,7 @@ public function testSecondaryWritePrimaryFirst() {
 
     $logs = $this->configImporter->getErrors();
     $this->assertEqual(count($logs), 1);
-    $this->assertEqual($logs[0], SafeMarkup::format('Deleted and replaced configuration entity "@name"', ['@name' => $name_secondary]));
+    $this->assertEqual($logs[0], 'Deleted and replaced configuration entity "' . $name_secondary . '"');
   }
 
   /**
@@ -373,7 +372,7 @@ public function testSecondaryUpdateDeletedDeleterFirst() {
 
     $logs = $this->configImporter->getErrors();
     $this->assertEqual(count($logs), 1);
-    $this->assertEqual($logs[0], SafeMarkup::format('Update target "@name" is missing.', ['@name' => $name_deletee]));
+    $this->assertEqual($logs[0], 'Update target "' . $name_deletee . '" is missing.');
   }
 
   /**
