diff --git a/core/modules/shortcut/src/Tests/ShortcutSetsTest.php b/core/modules/shortcut/src/Tests/ShortcutSetsTest.php
index 49a9611..485beaf 100644
--- a/core/modules/shortcut/src/Tests/ShortcutSetsTest.php
+++ b/core/modules/shortcut/src/Tests/ShortcutSetsTest.php
@@ -131,7 +131,9 @@ function testShortcutSetSwitchCreate() {
function testShortcutSetSwitchNoSetName() {
$edit = array('set' => 'new');
$this->drupalPostForm('user/' . $this->adminUser->id() . '/shortcuts', $edit, t('Change set'));
- $this->assertRaw(t('1 error has been found: New set'));
+ $this->assertRaw(formatPlural(1, '1 error has been found: !errors', '@count errors have been found: !errors', [
+ '!errors' => SafeMarkup::set('New set')
+ ]));
$current_set = shortcut_current_displayed_set($this->adminUser);
$this->assertEqual($current_set->id(), $this->set->id(), 'Attempting to switch to a new shortcut set without providing a set name does not succeed.');
}
diff --git a/core/modules/system/src/Tests/Form/ValidationTest.php b/core/modules/system/src/Tests/Form/ValidationTest.php
index fb0ac7e..a781fd4 100644
--- a/core/modules/system/src/Tests/Form/ValidationTest.php
+++ b/core/modules/system/src/Tests/Form/ValidationTest.php
@@ -292,7 +292,9 @@ protected function assertErrorMessages($messages) {
// Gather the element for checking the jump link section.
$error_links[] = \Drupal::l($message['title'], Url::fromRoute('', [], ['fragment' => 'edit-' . str_replace('_', '-', $message['key']), 'external' => TRUE]));
}
- $top_message = \Drupal::translation()->formatPlural(count($error_links), '1 error has been found', '@count errors have been found') . ': ' . implode(', ', $error_links);
+ $top_message = formatPlural(count($error_links), '1 error has been found: !errors', '@count errors have been found: !errors', [
+ '!errors' => SafeMarkup::set(implode(', ', $error_links))
+ ]);
$this->assertRaw($top_message);
$this->assertNoText(t('An illegal choice has been detected. Please contact the site administrator.'));
}
diff --git a/core/modules/user/src/Tests/UserBlocksTest.php b/core/modules/user/src/Tests/UserBlocksTest.php
index 29f4203..1eba0d4 100644
--- a/core/modules/user/src/Tests/UserBlocksTest.php
+++ b/core/modules/user/src/Tests/UserBlocksTest.php
@@ -48,7 +48,9 @@ function testUserLoginBlock() {
$edit['name'] = $this->randomMachineName();
$edit['pass'] = $this->randomMachineName();
$this->drupalPostForm('node', $edit, t('Log in'));
- $this->assertText(t('1 error has been found'));
+ $this->assertRaw(formatPlural(1, '1 error has been found: !errors', '@count errors have been found: !errors', [
+ '!errors' => SafeMarkup::set('Username')
+ ]));
$this->assertText(t('Sorry, unrecognized username or password.'));
// Create a user with some permission that anonymous users lack.