diff --git a/core/modules/shortcut/src/Tests/ShortcutSetsTest.php b/core/modules/shortcut/src/Tests/ShortcutSetsTest.php
index 485beaf..151c0a0 100644
--- a/core/modules/shortcut/src/Tests/ShortcutSetsTest.php
+++ b/core/modules/shortcut/src/Tests/ShortcutSetsTest.php
@@ -131,7 +131,7 @@ function testShortcutSetSwitchCreate() {
function testShortcutSetSwitchNoSetName() {
$edit = array('set' => 'new');
$this->drupalPostForm('user/' . $this->adminUser->id() . '/shortcuts', $edit, t('Change set'));
- $this->assertRaw(formatPlural(1, '1 error has been found: !errors', '@count errors have been found: !errors', [
+ $this->assertRaw(\Drupal::translation()->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);
diff --git a/core/modules/system/src/Tests/Form/ValidationTest.php b/core/modules/system/src/Tests/Form/ValidationTest.php
index a781fd4..e145b72 100644
--- a/core/modules/system/src/Tests/Form/ValidationTest.php
+++ b/core/modules/system/src/Tests/Form/ValidationTest.php
@@ -292,7 +292,7 @@ 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 = formatPlural(count($error_links), '1 error has been found: !errors', '@count errors have been found: !errors', [
+ $top_message = \Drupal::translation()->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);
diff --git a/core/modules/user/src/Tests/UserBlocksTest.php b/core/modules/user/src/Tests/UserBlocksTest.php
index 1eba0d4..2a46671 100644
--- a/core/modules/user/src/Tests/UserBlocksTest.php
+++ b/core/modules/user/src/Tests/UserBlocksTest.php
@@ -48,7 +48,7 @@ function testUserLoginBlock() {
$edit['name'] = $this->randomMachineName();
$edit['pass'] = $this->randomMachineName();
$this->drupalPostForm('node', $edit, t('Log in'));
- $this->assertRaw(formatPlural(1, '1 error has been found: !errors', '@count errors have been found: !errors', [
+ $this->assertRaw(\Drupal::translation()->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.'));