diff --git a/core/modules/aggregator/tests/src/Functional/ItemCacheTagsTest.php b/core/modules/aggregator/tests/src/Functional/ItemCacheTagsTest.php index c7bce98ff21..93b6e8e48d9 100644 --- a/core/modules/aggregator/tests/src/Functional/ItemCacheTagsTest.php +++ b/core/modules/aggregator/tests/src/Functional/ItemCacheTagsTest.php @@ -56,7 +56,7 @@ class ItemCacheTagsTest extends EntityCacheTagsTestBase { // Create a "Llama" aggregator feed item. $item = Item::create([ 'fid' => $feed->id(), - 'title' => t('Llama'), + 'title' => 'Llama', 'path' => 'https://www.drupal.org/', ]); $item->save(); @@ -77,7 +77,7 @@ class ItemCacheTagsTest extends EntityCacheTagsTestBase { // Now create a feed item in that feed. Item::create([ 'fid' => $this->entity->getFeedId(), - 'title' => t('Llama 2'), + 'title' => 'Llama 2', 'path' => 'https://groups.drupal.org/', ])->save(); diff --git a/core/modules/aggregator/tests/src/Kernel/ItemWithoutFeedTest.php b/core/modules/aggregator/tests/src/Kernel/ItemWithoutFeedTest.php index f4a5e8f3f34..8a604eeb701 100644 --- a/core/modules/aggregator/tests/src/Kernel/ItemWithoutFeedTest.php +++ b/core/modules/aggregator/tests/src/Kernel/ItemWithoutFeedTest.php @@ -31,7 +31,7 @@ class ItemWithoutFeedTest extends KernelTestBase { */ public function testEntityCreation() { $entity = Item::create([ - 'title' => t('Llama 2'), + 'title' => 'Llama 2', 'path' => 'https://groups.drupal.org/', ]); $violations = $entity->validate(); diff --git a/core/modules/block/tests/src/Kernel/BlockInterfaceTest.php b/core/modules/block/tests/src/Kernel/BlockInterfaceTest.php index 49772173409..d47ac18cff8 100644 --- a/core/modules/block/tests/src/Kernel/BlockInterfaceTest.php +++ b/core/modules/block/tests/src/Kernel/BlockInterfaceTest.php @@ -59,7 +59,7 @@ class BlockInterfaceTest extends KernelTestBase { ], 'admin_label' => [ '#type' => 'item', - '#title' => t('Block description'), + '#title' => 'Block description', '#plain_text' => $definition['admin_label'], ], 'label' => [ @@ -78,7 +78,7 @@ class BlockInterfaceTest extends KernelTestBase { 'context_mapping' => [], 'display_message' => [ '#type' => 'textfield', - '#title' => t('Display message'), + '#title' => 'Display message', '#default_value' => 'My custom display message.', ], ]; diff --git a/core/modules/comment/tests/src/Functional/CommentPagerTest.php b/core/modules/comment/tests/src/Functional/CommentPagerTest.php index 6e3d1b85337..ef4fe3c018f 100644 --- a/core/modules/comment/tests/src/Functional/CommentPagerTest.php +++ b/core/modules/comment/tests/src/Functional/CommentPagerTest.php @@ -370,11 +370,8 @@ class CommentPagerTest extends CommentTestBase { // Set comments to one per page so that we are able to test paging without // needing to insert large numbers of comments. $this->setCommentsPerPage(1, $field_name); - for ($i = 0; $i < 3; $i++) { - $comment = t('Comment @count on field @field', [ - '@count' => $i + 1, - '@field' => $field_name, - ]); + for ($i = 1; $i <= 4; $i++) { + $comment = "Comment $i on field $field_name"; $comments[] = $this->postComment($node, $comment, $comment, TRUE, $field_name); } } diff --git a/core/modules/comment/tests/src/Functional/CommentStatusFieldAccessTest.php b/core/modules/comment/tests/src/Functional/CommentStatusFieldAccessTest.php index 9a34ac30387..cddb174fed9 100644 --- a/core/modules/comment/tests/src/Functional/CommentStatusFieldAccessTest.php +++ b/core/modules/comment/tests/src/Functional/CommentStatusFieldAccessTest.php @@ -57,7 +57,7 @@ class CommentStatusFieldAccessTest extends BrowserTestBase { parent::setUp(); $node_type = NodeType::create([ 'type' => 'article', - 'name' => t('Article'), + 'name' => 'Article', ]); $node_type->save(); $this->nodeAuthor = $this->drupalCreateUser([ diff --git a/core/modules/comment/tests/src/Functional/Views/NodeCommentsTest.php b/core/modules/comment/tests/src/Functional/Views/NodeCommentsTest.php index 3c68670db75..685fbf22033 100644 --- a/core/modules/comment/tests/src/Functional/Views/NodeCommentsTest.php +++ b/core/modules/comment/tests/src/Functional/Views/NodeCommentsTest.php @@ -51,7 +51,7 @@ class NodeCommentsTest extends CommentTestBase { $this->assertCount(1, $comment_count_without_comment); // Create a content type with no comment field, and add a node. - $this->drupalCreateContentType(['type' => 'no_comment', 'name' => t('No comment page')]); + $this->drupalCreateContentType(['type' => 'no_comment', 'name' => 'No comment page']); $this->nodeUserPosted = $this->drupalCreateNode(['type' => 'no_comment']); $this->drupalGet('test-comment-count'); diff --git a/core/modules/comment/tests/src/Functional/Views/WizardTest.php b/core/modules/comment/tests/src/Functional/Views/WizardTest.php index 0103c3d1236..ecabc08b96b 100644 --- a/core/modules/comment/tests/src/Functional/Views/WizardTest.php +++ b/core/modules/comment/tests/src/Functional/Views/WizardTest.php @@ -33,7 +33,7 @@ class WizardTest extends WizardTestBase { */ protected function setUp($import_test_views = TRUE): void { parent::setUp($import_test_views); - $this->drupalCreateContentType(['type' => 'page', 'name' => t('Basic page')]); + $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']); // Add comment field to page node type. $this->addDefaultCommentField('node', 'page'); } diff --git a/core/modules/config/tests/src/Functional/ConfigEntityListTest.php b/core/modules/config/tests/src/Functional/ConfigEntityListTest.php index aa58a411ec6..e80cf5b4df3 100644 --- a/core/modules/config/tests/src/Functional/ConfigEntityListTest.php +++ b/core/modules/config/tests/src/Functional/ConfigEntityListTest.php @@ -59,17 +59,17 @@ class ConfigEntityListTest extends BrowserTestBase { // Test getOperations() method. $expected_operations = [ 'edit' => [ - 'title' => t('Edit'), + 'title' => 'Edit', 'weight' => 10, 'url' => $entity->toUrl()->setOption('query', $this->getRedirectDestination()->getAsArray()), ], 'disable' => [ - 'title' => t('Disable'), + 'title' => 'Disable', 'weight' => 40, 'url' => $entity->toUrl('disable')->setOption('query', $this->getRedirectDestination()->getAsArray()), ], 'delete' => [ - 'title' => t('Delete'), + 'title' => 'Delete', 'weight' => 100, 'url' => $entity->toUrl('delete-form')->setOption('query', $this->getRedirectDestination()->getAsArray()), ], @@ -134,12 +134,12 @@ class ConfigEntityListTest extends BrowserTestBase { // Test getOperations() method. $expected_operations = [ 'edit' => [ - 'title' => t('Edit'), + 'title' => 'Edit', 'weight' => 10, 'url' => $entity->toUrl()->setOption('query', $this->getRedirectDestination()->getAsArray()), ], 'delete' => [ - 'title' => t('Delete'), + 'title' => 'Delete', 'weight' => 100, 'url' => $entity->toUrl('delete-form')->setOption('query', $this->getRedirectDestination()->getAsArray()), ], diff --git a/core/modules/contact/tests/src/Functional/ContactPersonalTest.php b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php index 820201eea23..e28c8aae9b1 100644 --- a/core/modules/contact/tests/src/Functional/ContactPersonalTest.php +++ b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php @@ -3,7 +3,6 @@ namespace Drupal\Tests\contact\Functional; use Drupal\Component\Render\FormattableMarkup; -use Drupal\Component\Render\PlainTextOutput; use Drupal\Component\Utility\Html; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Test\AssertMailTrait; @@ -93,14 +92,9 @@ class ContactPersonalTest extends BrowserTestBase { $this->assertEquals($this->config('system.site')->get('mail'), $mail['from']); $this->assertEquals($this->webUser->getEmail(), $mail['reply-to']); $this->assertEquals('user_mail', $mail['key']); - $variables = [ - '@site-name' => $this->config('system.site')->get('name'), - '@subject' => $message['subject[0][value]'], - '@recipient-name' => $this->contactUser->getDisplayName(), - ]; - $subject = PlainTextOutput::renderFromHtml(t('[@site-name] @subject', $variables)); + $subject = '[' . $this->config('system.site')->get('name') . '] ' . $message['subject[0][value]']; $this->assertEquals($subject, $mail['subject'], 'Subject is in sent message.'); - $this->assertStringContainsString('Hello ' . $variables['@recipient-name'], $mail['body'], 'Recipient name is in sent message.'); + $this->assertStringContainsString('Hello ' . $this->contactUser->getDisplayName(), $mail['body'], 'Recipient name is in sent message.'); $this->assertStringContainsString($this->webUser->getDisplayName(), $mail['body'], 'Sender name is in sent message.'); $this->assertStringContainsString($message['message[0][value]'], $mail['body'], 'Message body is in sent message.'); @@ -128,7 +122,7 @@ class ContactPersonalTest extends BrowserTestBase { $message = $this->submitPersonalContact($this->contactUser, $message); // Assert mail content. - $this->assertMailString('body', 'Hello ' . $variables['@recipient-name'], 1); + $this->assertMailString('body', 'Hello ' . $this->contactUser->getDisplayName(), 1); $this->assertMailString('body', $this->webUser->getDisplayName(), 1); $this->assertMailString('body', Html::Escape($message['message[0][value]']), 1); } diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php index a57864d8355..9360122fb2b 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php @@ -225,7 +225,7 @@ class ContentTranslationWorkflowsTest extends ContentTranslationTestBase { $this->doTestWorkflows($this->administrator, $expected_status); // Check that translation permissions allow the associated operations. - $ops = ['create' => t('Add'), 'update' => t('Edit'), 'delete' => t('Delete')]; + $ops = ['create' => 'Add', 'update' => 'Edit', 'delete' => 'Delete']; $translations_url = $this->entity->toUrl('drupal:content-translation-overview'); foreach ($ops as $current_op => $item) { $user = $this->drupalCreateUser([ diff --git a/core/modules/dblog/tests/src/Functional/DbLogTest.php b/core/modules/dblog/tests/src/Functional/DbLogTest.php index 2965cd96f4d..4b7ef3c2266 100644 --- a/core/modules/dblog/tests/src/Functional/DbLogTest.php +++ b/core/modules/dblog/tests/src/Functional/DbLogTest.php @@ -377,8 +377,8 @@ class DbLogTest extends BrowserTestBase { private function verifyEvents() { // Invoke events. $this->doUser(); - $this->drupalCreateContentType(['type' => 'article', 'name' => t('Article')]); - $this->drupalCreateContentType(['type' => 'page', 'name' => t('Basic page')]); + $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); + $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']); $this->doNode('article'); $this->doNode('page'); $this->doNode('forum'); diff --git a/core/modules/field/tests/src/Functional/NestedFormTest.php b/core/modules/field/tests/src/Functional/NestedFormTest.php index 4dd8993d5cb..7621b07e3a3 100644 --- a/core/modules/field/tests/src/Functional/NestedFormTest.php +++ b/core/modules/field/tests/src/Functional/NestedFormTest.php @@ -204,7 +204,7 @@ class NestedFormTest extends FieldTestBase { // Submit the form and check that the entities are updated accordingly. $assert_session->hiddenFieldExists('entity_2[changed]') ->setValue(REQUEST_TIME - 86400); - $page->pressButton(t('Save')); + $page->pressButton('Save'); $elements = $this->cssSelect('.entity-2.error'); $this->assertCount(1, $elements, 'The whole nested entity form has been correctly flagged with an error class.'); diff --git a/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php b/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php index 85b056e6575..1d54d284713 100644 --- a/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php +++ b/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php @@ -166,12 +166,7 @@ class ManageFieldsFunctionalTest extends BrowserTestBase { $type = empty($type) ? $this->contentType : $type; $this->drupalGet('admin/structure/types/manage/' . $type . '/fields'); // Check all table columns. - $table_headers = [ - t('Label'), - t('Machine name'), - t('Field type'), - t('Operations'), - ]; + $table_headers = ['Label', 'Machine name', 'Field type', 'Operations']; foreach ($table_headers as $table_header) { // We check that the label appear in the table headings. $this->assertSession()->responseContains($table_header . ''); @@ -688,7 +683,7 @@ class ManageFieldsFunctionalTest extends BrowserTestBase { 'field_name' => $field_name, 'bundle' => $this->contentType, 'entity_type' => 'node', - 'label' => t('Hidden field'), + 'label' => 'Hidden field', ]; FieldConfig::create($field)->save(); \Drupal::service('entity_display.repository') diff --git a/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php b/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php index dbd1b088169..c0ee1aff261 100644 --- a/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php +++ b/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php @@ -454,7 +454,7 @@ class ManageDisplayTest extends WebDriverTestBase { $field_field_name->setValue($field_name); $assert_session->assertWaitOnAjaxRequest(); - $page->findButton(t('Save and continue'))->click(); + $page->findButton('Save and continue')->click(); $assert_session->pageTextContains("These settings apply to the $label field everywhere it is used."); $breadcrumb_link = $page->findLink($label); diff --git a/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php b/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php index 9312e7a2718..84ad60cd3c0 100644 --- a/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php +++ b/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php @@ -629,7 +629,7 @@ class EntityDisplayTest extends KernelTestBase { $this->assertNull($form_display->getComponent($field_name)); $this->assertTrue($form_display->get('hidden')[$field_name]); // The correct warning message has been logged. - $arguments = ['@display' => (string) t('Entity form display'), '@id' => $form_display->id(), '@name' => $field_name]; + $arguments = ['@display' => 'Entity form display', '@id' => $form_display->id(), '@name' => $field_name]; $variables = Database::getConnection()->select('watchdog', 'w') ->fields('w', ['variables']) ->condition('type', 'system') diff --git a/core/modules/file/tests/src/Functional/FilePrivateTest.php b/core/modules/file/tests/src/Functional/FilePrivateTest.php index 8d82b2fb34b..c1f4b3d2367 100644 --- a/core/modules/file/tests/src/Functional/FilePrivateTest.php +++ b/core/modules/file/tests/src/Functional/FilePrivateTest.php @@ -90,7 +90,7 @@ class FilePrivateTest extends FileFieldTestBase { // Can't use submitForm() to set hidden fields. $this->drupalGet('node/' . $new_node->id() . '/edit'); $this->getSession()->getPage()->find('css', 'input[name="' . $field_name . '[0][fids]"]')->setValue($node_file->id()); - $this->getSession()->getPage()->pressButton(t('Save')); + $this->getSession()->getPage()->pressButton('Save'); $this->assertSession()->addressEquals('node/' . $new_node->id()); // Make sure the submitted hidden file field is empty. $new_node = \Drupal::entityTypeManager()->getStorage('node')->loadUnchanged($new_node->id()); @@ -103,7 +103,7 @@ class FilePrivateTest extends FileFieldTestBase { $this->drupalGet('node/add/' . $type_name); $this->getSession()->getPage()->find('css', 'input[name="title[0][value]"]')->setValue($edit['title[0][value]']); $this->getSession()->getPage()->find('css', 'input[name="' . $field_name . '[0][fids]"]')->setValue($node_file->id()); - $this->getSession()->getPage()->pressButton(t('Save')); + $this->getSession()->getPage()->pressButton('Save'); $new_node = $this->drupalGetNodeByTitle($edit['title[0][value]']); $this->assertSession()->addressEquals('node/' . $new_node->id()); // Make sure the submitted hidden file field is empty. diff --git a/core/modules/file/tests/src/FunctionalJavascript/FileManagedFileElementTest.php b/core/modules/file/tests/src/FunctionalJavascript/FileManagedFileElementTest.php index 18c197746d6..20dfa742fdc 100644 --- a/core/modules/file/tests/src/FunctionalJavascript/FileManagedFileElementTest.php +++ b/core/modules/file/tests/src/FunctionalJavascript/FileManagedFileElementTest.php @@ -76,7 +76,7 @@ class FileManagedFileElementTest extends WebDriverTestBase { $this->submitForm([], 'Save'); // Remove, then Submit. - $remove_button_title = $multiple ? t('Remove selected') : t('Remove'); + $remove_button_title = $multiple ? 'Remove selected' : 'Remove'; $this->drupalGet($path . '/' . $last_fid); if ($multiple) { $selected_checkbox = ($tree ? 'nested[file]' : 'file') . '[file_' . $last_fid . '][selected]'; diff --git a/core/modules/filter/tests/src/Functional/FilterHtmlImageSecureTest.php b/core/modules/filter/tests/src/Functional/FilterHtmlImageSecureTest.php index 25d101977b9..3d5e5ee756a 100644 --- a/core/modules/filter/tests/src/Functional/FilterHtmlImageSecureTest.php +++ b/core/modules/filter/tests/src/Functional/FilterHtmlImageSecureTest.php @@ -94,8 +94,6 @@ class FilterHtmlImageSecureTest extends BrowserTestBase { $druplicon = 'core/misc/druplicon.png'; $red_x_image = base_path() . 'core/misc/icons/e32700/error.svg'; - $alt_text = t('Image removed.'); - $title_text = t('This image has been removed. For security reasons, only images from the local domain are allowed.'); // Put a test image in the files directory. $test_images = $this->getTestFiles('image'); @@ -152,8 +150,8 @@ class FilterHtmlImageSecureTest extends BrowserTestBase { $found = TRUE; if ($converted == $red_x_image) { $this->assertEquals($red_x_image, $element->getAttribute('src')); - $this->assertEquals($alt_text, $element->getAttribute('alt')); - $this->assertEquals($title_text, $element->getAttribute('title')); + $this->assertEquals('Image removed.', $element->getAttribute('alt')); + $this->assertEquals('This image has been removed. For security reasons, only images from the local domain are allowed.', $element->getAttribute('title')); $this->assertEquals('16', $element->getAttribute('height')); $this->assertEquals('16', $element->getAttribute('width')); } diff --git a/core/modules/forum/tests/src/Functional/ForumTest.php b/core/modules/forum/tests/src/Functional/ForumTest.php index 50d5a302c13..4d1e0767eac 100644 --- a/core/modules/forum/tests/src/Functional/ForumTest.php +++ b/core/modules/forum/tests/src/Functional/ForumTest.php @@ -584,14 +584,13 @@ class ForumTest extends BrowserTestBase { $this->drupalGet('node/add/forum', ['query' => ['forum_id' => $tid]]); $this->submitForm($edit, 'Save'); - $type = t('Forum topic'); if ($container) { - $this->assertSession()->pageTextNotContains("$type $title has been created."); + $this->assertSession()->pageTextNotContains("Forum topic $title has been created."); $this->assertSession()->pageTextContains("The item {$forum['name']} is a forum container, not a forum."); return; } else { - $this->assertSession()->pageTextContains($type . ' ' . $title . ' has been created.'); + $this->assertSession()->pageTextContains("Forum topic $title has been created."); $this->assertSession()->pageTextNotContains("The item {$forum['name']} is a forum container, not a forum."); // Verify that the creation message contains a link to a node. @@ -644,8 +643,8 @@ class ForumTest extends BrowserTestBase { $this->assertSession()->statusCodeEquals(200); $this->assertSession()->titleEquals($node->label() . ' | Drupal'); $breadcrumb_build = [ - Link::createFromRoute(t('Home'), ''), - Link::createFromRoute(t('Forums'), 'forum.index'), + Link::createFromRoute('Home', ''), + Link::createFromRoute('Forums', 'forum.index'), Link::createFromRoute($this->forumContainer['name'], 'forum.page', ['taxonomy_term' => $this->forumContainer['tid']]), Link::createFromRoute($this->forum['name'], 'forum.page', ['taxonomy_term' => $this->forum['tid']]), ]; @@ -708,8 +707,8 @@ class ForumTest extends BrowserTestBase { $this->assertSession()->titleEquals($forum['name'] . ' | Drupal'); $breadcrumb_build = [ - Link::createFromRoute(t('Home'), ''), - Link::createFromRoute(t('Forums'), 'forum.index'), + Link::createFromRoute('Home', ''), + Link::createFromRoute('Forums', 'forum.index'), ]; if (isset($parent)) { $breadcrumb_build[] = Link::createFromRoute($parent['name'], 'forum.page', ['taxonomy_term' => $parent['tid']]); diff --git a/core/modules/forum/tests/src/Functional/ForumUninstallTest.php b/core/modules/forum/tests/src/Functional/ForumUninstallTest.php index 440d3b9f94a..30ea8c1fd07 100644 --- a/core/modules/forum/tests/src/Functional/ForumUninstallTest.php +++ b/core/modules/forum/tests/src/Functional/ForumUninstallTest.php @@ -45,7 +45,7 @@ class ForumUninstallTest extends BrowserTestBase { // Create a taxonomy term. $term = Term::create([ - 'name' => t('A term'), + 'name' => 'A term', 'langcode' => \Drupal::languageManager()->getDefaultLanguage()->getId(), 'description' => '', 'parent' => [0], diff --git a/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php b/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php index 4e3d31cfa74..551c77aa0eb 100644 --- a/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php +++ b/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php @@ -437,7 +437,7 @@ class ImageFieldDisplayTest extends ImageFieldTestBase { // Can't use fillField cause Mink can't fill hidden fields. $this->drupalGet("admin/structure/types/manage/article/fields/node.article.$field_name/storage"); $this->getSession()->getPage()->find('css', 'input[name="settings[default_image][uuid][fids]"]')->setValue(0); - $this->getSession()->getPage()->pressButton(t('Save field settings')); + $this->getSession()->getPage()->pressButton('Save field settings'); // Clear field definition cache so the new default image is detected. \Drupal::service('entity_field.manager')->clearCachedFieldDefinitions(); diff --git a/core/modules/image/tests/src/FunctionalJavascript/ImageFieldValidateTest.php b/core/modules/image/tests/src/FunctionalJavascript/ImageFieldValidateTest.php index 75d1b058eea..b0a198312f8 100644 --- a/core/modules/image/tests/src/FunctionalJavascript/ImageFieldValidateTest.php +++ b/core/modules/image/tests/src/FunctionalJavascript/ImageFieldValidateTest.php @@ -56,7 +56,7 @@ class ImageFieldValidateTest extends ImageFieldTestBase { 'entity_type' => 'node', 'bundle' => 'article', 'field_name' => 'field_dummy_select', - 'label' => t('Dummy select'), + 'label' => 'Dummy select', ])->save(); \Drupal::entityTypeManager() diff --git a/core/modules/jsonapi/tests/src/Functional/ActionTest.php b/core/modules/jsonapi/tests/src/Functional/ActionTest.php index 4fcc0e9e2bb..9450f274ec6 100644 --- a/core/modules/jsonapi/tests/src/Functional/ActionTest.php +++ b/core/modules/jsonapi/tests/src/Functional/ActionTest.php @@ -54,7 +54,7 @@ class ActionTest extends ResourceTestBase { $action = Action::create([ 'id' => 'user_add_role_action.' . RoleInterface::ANONYMOUS_ID, 'type' => 'user', - 'label' => t('Add the anonymous role to the selected users'), + 'label' => 'Add the anonymous role to the selected users', 'configuration' => [ 'rid' => RoleInterface::ANONYMOUS_ID, ], diff --git a/core/modules/jsonapi/tests/src/Functional/ShortcutTest.php b/core/modules/jsonapi/tests/src/Functional/ShortcutTest.php index 6267a483364..c03a78ab651 100644 --- a/core/modules/jsonapi/tests/src/Functional/ShortcutTest.php +++ b/core/modules/jsonapi/tests/src/Functional/ShortcutTest.php @@ -65,7 +65,7 @@ class ShortcutTest extends ResourceTestBase { protected function createEntity() { $shortcut = Shortcut::create([ 'shortcut_set' => 'default', - 'title' => t('Comments'), + 'title' => 'Comments', 'weight' => -20, 'link' => [ 'uri' => 'internal:/user/logout', diff --git a/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php b/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php index 6a8dd157190..d6b71e3a36a 100644 --- a/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php +++ b/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php @@ -53,7 +53,7 @@ class ConfigurableLanguageManagerTest extends BrowserTestBase { // Create a page node type and make it translatable. NodeType::create([ 'type' => 'page', - 'name' => t('Page'), + 'name' => 'Page', ])->save(); $config = ContentLanguageSettings::loadByEntityTypeBundle('node', 'page'); diff --git a/core/modules/language/tests/src/Functional/LanguageBreadcrumbTest.php b/core/modules/language/tests/src/Functional/LanguageBreadcrumbTest.php index 64028cf28c9..a01d65dba15 100644 --- a/core/modules/language/tests/src/Functional/LanguageBreadcrumbTest.php +++ b/core/modules/language/tests/src/Functional/LanguageBreadcrumbTest.php @@ -40,7 +40,7 @@ class LanguageBreadcrumbTest extends BrowserTestBase { public function testBreadCrumbs() { // Prepare common base breadcrumb elements. $home = ['' => 'Home']; - $admin = $home + ['admin' => t('Administration')]; + $admin = $home + ['admin' => 'Administration']; $page = $this->getSession()->getPage(); diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php b/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php index bf19edd0961..c1a561550d8 100644 --- a/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php @@ -3,7 +3,6 @@ namespace Drupal\Tests\locale\Functional; use Drupal\Core\Url; -use Drupal\Component\Render\FormattableMarkup; /** * Tests for the user interface of project interface translations. @@ -97,12 +96,7 @@ class LocaleUpdateInterfaceTest extends LocaleUpdateBase { $this->assertSession()->linkByHrefExists(Url::fromRoute('locale.translate_status')->toString()); $this->drupalGet('admin/reports/translations'); $this->assertSession()->pageTextContains('Missing translations for one project'); - $release_details = new FormattableMarkup('@module (@version). @info', [ - '@module' => 'Locale test translate', - '@version' => '1.3-dev', - '@info' => t('File not found at %local_path', ['%local_path' => 'core/modules/locale/tests/test.de.po']), - ]); - $this->assertSession()->responseContains($release_details->__toString()); + $this->assertSession()->pageTextContains('Locale test translate (1.3-dev). File not found at core/modules/locale/tests/test.de.po'); // Override Drupal core translation status as 'no translations found'. $status = locale_translation_get_status(); diff --git a/core/modules/media/tests/src/Kernel/MediaSourceTest.php b/core/modules/media/tests/src/Kernel/MediaSourceTest.php index cf6a75cae70..07e76454484 100644 --- a/core/modules/media/tests/src/Kernel/MediaSourceTest.php +++ b/core/modules/media/tests/src/Kernel/MediaSourceTest.php @@ -582,7 +582,7 @@ class MediaSourceTest extends MediaKernelTestBase { $form_state->setValues([ 'label' => 'Test type', 'id' => $source_plugin_id, - 'op' => t('Save'), + 'op' => 'Save', ]); /** @var \Drupal\Core\Entity\EntityFieldManagerInterface $field_manager */ diff --git a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentDeleteFormTest.php b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentDeleteFormTest.php index 87e6c684f2f..cd7b6aaaeb5 100644 --- a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentDeleteFormTest.php +++ b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentDeleteFormTest.php @@ -41,7 +41,7 @@ class MenuLinkContentDeleteFormTest extends BrowserTestBase { // Add new menu item. $this->drupalGet('admin/structure/menu/manage/admin/add'); $this->submitForm([ - 'title[0][value]' => t('Front page'), + 'title[0][value]' => 'Front page', 'link[0][uri]' => '', ], 'Save'); $this->assertSession()->pageTextContains('The menu link has been saved.'); diff --git a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php index b57bc58d55c..d4e47cc3a70 100644 --- a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php +++ b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php @@ -89,7 +89,7 @@ class MenuLinkContentFormTest extends BrowserTestBase { $this->assertSession()->pageTextContains('The location this menu link points to.'); $this->submitForm([ - 'title[0][value]' => t('Front page'), + 'title[0][value]' => 'Front page', 'link[0][uri]' => '', ], 'Save'); $this->assertSession()->pageTextContains('The menu link has been saved.'); @@ -101,7 +101,7 @@ class MenuLinkContentFormTest extends BrowserTestBase { public function testMenuLinkContentFormValidation() { $this->drupalGet('admin/structure/menu/manage/admin/add'); $this->submitForm([ - 'title[0][value]' => t('Test page'), + 'title[0][value]' => 'Test page', 'link[0][uri]' => '', ], 'Save'); $this->assertSession()->pageTextContains('Manually entered paths should start with one of the following characters: / ? #'); diff --git a/core/modules/menu_ui/tests/src/Functional/MenuUiContentModerationTest.php b/core/modules/menu_ui/tests/src/Functional/MenuUiContentModerationTest.php index 02d8d038f3c..2491150a6f5 100644 --- a/core/modules/menu_ui/tests/src/Functional/MenuUiContentModerationTest.php +++ b/core/modules/menu_ui/tests/src/Functional/MenuUiContentModerationTest.php @@ -74,13 +74,13 @@ class MenuUiContentModerationTest extends BrowserTestBase { // Publish the node with no changes. $this->drupalGet('node/' . $node->id() . '/edit'); $this->submitForm([], 'Save'); - $this->assertSession()->responseContains(t('Page %label has been updated.', ['%label' => $node->toLink($node->label())->toString()])); + $this->assertSession()->pageTextContains("Page {$node->label()} has been updated."); // Create a pending revision with no changes. $edit = ['moderation_state[0][state]' => 'draft']; $this->drupalGet('node/' . $node->id() . '/edit'); $this->submitForm($edit, 'Save'); - $this->assertSession()->responseContains(t('Page %label has been updated.', ['%label' => $node->toLink($node->label())->toString()])); + $this->assertSession()->pageTextContains("Page {$node->label()} has been updated."); // Add a menu link and save a new default (published) revision. $edit = [ @@ -138,7 +138,7 @@ class MenuUiContentModerationTest extends BrowserTestBase { ]; $this->drupalGet('node/' . $node->id() . '/edit'); $this->submitForm($edit, 'Save'); - $this->assertSession()->responseContains(t('Page %label has been updated.', ['%label' => $node->toLink($node->label())->toString()])); + $this->assertSession()->pageTextContains("Page {$node->label()} has been updated."); // Ensure the content was not immediately published. $this->assertSession()->linkExists('Test menu link'); @@ -164,7 +164,7 @@ class MenuUiContentModerationTest extends BrowserTestBase { $edit = ['moderation_state[0][state]' => 'published']; $this->drupalGet('node/' . $node->id() . '/edit'); $this->submitForm($edit, 'Save'); - $this->assertSession()->responseContains(t('Page %label has been updated.', ['%label' => $node->toLink($node->label())->toString()])); + $this->assertSession()->pageTextContains("Page {$node->label()} has been updated."); // Add a menu link and save and create a new non-default (draft) revision // and ensure it's not immediately published. @@ -175,7 +175,7 @@ class MenuUiContentModerationTest extends BrowserTestBase { ]; $this->drupalGet('node/' . $node->id() . '/edit'); $this->submitForm($edit, 'Save'); - $this->assertSession()->responseContains(t('Page %label has been updated.', ['%label' => $node->toLink($node->label())->toString()])); + $this->assertSession()->pageTextContains("Page {$node->label()} has been updated."); $this->assertSession()->linkNotExists('Second test menu link'); // Publish the content and ensure the new menu link shows up. @@ -184,7 +184,7 @@ class MenuUiContentModerationTest extends BrowserTestBase { ]; $this->drupalGet('node/' . $node->id() . '/edit'); $this->submitForm($edit, 'Save'); - $this->assertSession()->responseContains(t('Page %label has been updated.', ['%label' => $node->toLink($node->label())->toString()])); + $this->assertSession()->pageTextContains("Page {$node->label()} has been updated."); $this->assertSession()->linkExists('Second test menu link'); } diff --git a/core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php b/core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php index 4da75756538..87731aadb09 100644 --- a/core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php +++ b/core/modules/migrate_drupal/tests/src/Unit/source/d6/Drupal6SqlBaseTest.php @@ -146,16 +146,16 @@ class TestDrupal6SqlBase extends DrupalSqlBase { */ public function fields() { return [ - 'filename' => t('The path of the primary file for this item.'), - 'name' => t('The name of the item; e.g. node.'), - 'type' => t('The type of the item, either module, theme, or theme_engine.'), - 'owner' => t("A theme's 'parent'. Can be either a theme or an engine."), - 'status' => t('Boolean indicating whether or not this item is enabled.'), - 'throttle' => t('Boolean indicating whether this item is disabled when the throttle.module disables throttleable items.'), - 'bootstrap' => t("Boolean indicating whether this module is loaded during Drupal's early bootstrapping phase (e.g. even before the page cache is consulted)."), - 'schema_version' => t("The module's database schema version number."), - 'weight' => t("The order in which this module's hooks should be invoked."), - 'info' => t("A serialized array containing information from the module's .info file."), + 'filename' => $this->t('The path of the primary file for this item.'), + 'name' => $this->t('The name of the item; e.g. node.'), + 'type' => $this->t('The type of the item, either module, theme, or theme_engine.'), + 'owner' => $this->t("A theme's 'parent'. Can be either a theme or an engine."), + 'status' => $this->t('Boolean indicating whether or not this item is enabled.'), + 'throttle' => $this->t('Boolean indicating whether this item is disabled when the throttle.module disables throttleable items.'), + 'bootstrap' => $this->t("Boolean indicating whether this module is loaded during Drupal's early bootstrapping phase (e.g. even before the page cache is consulted)."), + 'schema_version' => $this->t("The module's database schema version number."), + 'weight' => $this->t("The order in which this module's hooks should be invoked."), + 'info' => $this->t("A serialized array containing information from the module's .info file."), ]; } diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/SourceProviderTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/SourceProviderTest.php index 9fa261d2a31..e6768723eb8 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/SourceProviderTest.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/SourceProviderTest.php @@ -32,8 +32,8 @@ class SourceProviderTest extends MigrateUpgradeTestBase { $this->submitCredentialForm(); // Ensure we get errors about missing modules. - $session->pageTextContains(t('Resolve all issues below to continue the upgrade.')); - $session->pageTextContains(t('The no_source_module plugin must define the source_module property.')); + $session->pageTextContains('Resolve all issues below to continue the upgrade.'); + $session->pageTextContains('The no_source_module plugin must define the source_module property.'); // Uninstall the module causing the missing module error messages. $this->container->get('module_installer') @@ -45,10 +45,10 @@ class SourceProviderTest extends MigrateUpgradeTestBase { $this->submitForm($this->edits, 'Review upgrade'); // Ensure there are no errors about missing modules from the test module. - $session->pageTextNotContains(t('Source module not found for migration_provider_no_annotation.')); - $session->pageTextNotContains(t('Source module not found for migration_provider_test.')); + $session->pageTextNotContains('Source module not found for migration_provider_no_annotation.'); + $session->pageTextNotContains('Source module not found for migration_provider_test.'); // Ensure there are no errors about any other missing migration providers. - $session->pageTextNotContains(t('module not found')); + $session->pageTextNotContains('module not found'); } /** diff --git a/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php b/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php index 7b6889d9c34..a20379f1682 100644 --- a/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php +++ b/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php @@ -108,7 +108,7 @@ class NodeAccessBaseTableTest extends NodeTestBase { $this->drupalLogin($this->webUser); foreach ([0 => 'Public', 1 => 'Private'] as $is_private => $type) { $edit = [ - 'title[0][value]' => t('@private_public Article created by @user', ['@private_public' => $type, '@user' => $this->webUser->getAccountName()]), + 'title[0][value]' => "$type Article created by " . $this->webUser->getAccountName(), ]; if ($is_private) { $edit['private[0][value]'] = TRUE; diff --git a/core/modules/node/tests/src/Functional/NodeAccessPagerTest.php b/core/modules/node/tests/src/Functional/NodeAccessPagerTest.php index c47c35dda15..9000a1f6617 100644 --- a/core/modules/node/tests/src/Functional/NodeAccessPagerTest.php +++ b/core/modules/node/tests/src/Functional/NodeAccessPagerTest.php @@ -32,7 +32,7 @@ class NodeAccessPagerTest extends BrowserTestBase { parent::setUp(); node_access_rebuild(); - $this->drupalCreateContentType(['type' => 'page', 'name' => t('Basic page')]); + $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']); $this->addDefaultCommentField('node', 'page'); $this->webUser = $this->drupalCreateUser([ 'access content', diff --git a/core/modules/node/tests/src/Functional/NodeEntityViewModeAlterTest.php b/core/modules/node/tests/src/Functional/NodeEntityViewModeAlterTest.php index e1357d705bf..25a2758717b 100644 --- a/core/modules/node/tests/src/Functional/NodeEntityViewModeAlterTest.php +++ b/core/modules/node/tests/src/Functional/NodeEntityViewModeAlterTest.php @@ -37,8 +37,8 @@ class NodeEntityViewModeAlterTest extends NodeTestBase { // Create a node. $edit = []; $edit['title[0][value]'] = $this->randomMachineName(8); - $edit['body[0][value]'] = t('Data that should appear only in the body for the node.'); - $edit['body[0][summary]'] = t('Extra data that should appear only in the teaser for the node.'); + $edit['body[0][value]'] = 'Data that should appear only in the body for the node.'; + $edit['body[0][summary]'] = 'Extra data that should appear only in the teaser for the node.'; $this->drupalGet('node/add/page'); $this->submitForm($edit, 'Save'); diff --git a/core/modules/node/tests/src/Functional/NodeRSSContentTest.php b/core/modules/node/tests/src/Functional/NodeRSSContentTest.php index 1fd49d3eb67..a7a1ad4e88f 100644 --- a/core/modules/node/tests/src/Functional/NodeRSSContentTest.php +++ b/core/modules/node/tests/src/Functional/NodeRSSContentTest.php @@ -60,7 +60,7 @@ class NodeRSSContentTest extends NodeTestBase { $this->assertSession()->responseNotContains($non_rss_content); // Check that extra RSS elements and namespaces are added to RSS feed. - $test_element = '' . t('Value of testElement RSS element for node @nid.', ['@nid' => $node->id()]) . ''; + $test_element = "Value of testElement RSS element for node {$node->id()}."; $test_ns = 'xmlns:drupaltest="http://example.com/test-namespace"'; $this->assertSession()->responseContains($test_element); $this->assertSession()->responseContains($test_ns); diff --git a/core/modules/node/tests/src/Functional/NodeTranslationUITest.php b/core/modules/node/tests/src/Functional/NodeTranslationUITest.php index 624c70906c8..8934c958d92 100644 --- a/core/modules/node/tests/src/Functional/NodeTranslationUITest.php +++ b/core/modules/node/tests/src/Functional/NodeTranslationUITest.php @@ -456,7 +456,7 @@ class NodeTranslationUITest extends ContentTranslationUITestBase { if (!$entity->isNew() && $entity->isTranslatable()) { $translations = $entity->getTranslationLanguages(); if ((count($translations) > 1 || !isset($translations[$langcode])) && ($field = $entity->getFieldDefinition('status'))) { - return ' ' . ($field->isTranslatable() ? t('(this translation)') : t('(all translations)')); + return ' ' . ($field->isTranslatable() ? '(this translation)' : '(all translations)'); } } return ''; diff --git a/core/modules/node/tests/src/Functional/Views/FilterNodeAccessTest.php b/core/modules/node/tests/src/Functional/Views/FilterNodeAccessTest.php index a7b8b7f3785..30e75d63cb9 100644 --- a/core/modules/node/tests/src/Functional/Views/FilterNodeAccessTest.php +++ b/core/modules/node/tests/src/Functional/Views/FilterNodeAccessTest.php @@ -68,7 +68,7 @@ class FilterNodeAccessTest extends NodeTestBase { 'format' => filter_default_format(), ], ], - 'title' => t('@private_public Article created by @user', ['@private_public' => $type, '@user' => $web_user->getAccountName()]), + 'title' => "$type Article created by " . $web_user->getAccountName(), 'type' => 'article', 'uid' => $web_user->id(), 'private' => (bool) $is_private, diff --git a/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php b/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php index 1a5cfb93498..821727d1993 100644 --- a/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php +++ b/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php @@ -28,7 +28,7 @@ class PathTaxonomyTermTest extends PathTestBase { // Create a Tags vocabulary for the Article node type. $vocabulary = Vocabulary::create([ - 'name' => t('Tags'), + 'name' => 'Tags', 'vid' => 'tags', ]); $vocabulary->save(); diff --git a/core/modules/quickedit/tests/src/Functional/QuickEditCustomPipelineTest.php b/core/modules/quickedit/tests/src/Functional/QuickEditCustomPipelineTest.php index ab0b75c7ae6..e4cc514c241 100644 --- a/core/modules/quickedit/tests/src/Functional/QuickEditCustomPipelineTest.php +++ b/core/modules/quickedit/tests/src/Functional/QuickEditCustomPipelineTest.php @@ -77,7 +77,7 @@ class QuickEditCustomPipelineTest extends BrowserTestBase { 'body[0][summary]' => '', 'body[0][value]' => '

Fine thanks.

', 'body[0][format]' => 'filtered_html', - 'op' => t('Save'), + 'op' => 'Save', ]; // Assume there is another field on this page, which doesn't use a custom // render pipeline, but the default one, and it uses the "full" view mode. diff --git a/core/modules/quickedit/tests/src/Functional/QuickEditEndPointAccessTest.php b/core/modules/quickedit/tests/src/Functional/QuickEditEndPointAccessTest.php index fcf9de0c0d4..1cb90adf40d 100644 --- a/core/modules/quickedit/tests/src/Functional/QuickEditEndPointAccessTest.php +++ b/core/modules/quickedit/tests/src/Functional/QuickEditEndPointAccessTest.php @@ -61,7 +61,7 @@ class QuickEditEndPointAccessTest extends BrowserTestBase { $edit['body[0][summary]'] = ''; $edit['body[0][value]'] = '

Malicious content.

'; $edit['body[0][format]'] = 'filtered_html'; - $edit['op'] = t('Save'); + $edit['op'] = 'Save'; $this->assertAccessIsBlocked($url, $edit); $post = ['nocssjs' => 'true']; diff --git a/core/modules/quickedit/tests/src/Functional/QuickEditImageControllerTest.php b/core/modules/quickedit/tests/src/Functional/QuickEditImageControllerTest.php index 7642f6fcf0d..a1e3932c6d5 100644 --- a/core/modules/quickedit/tests/src/Functional/QuickEditImageControllerTest.php +++ b/core/modules/quickedit/tests/src/Functional/QuickEditImageControllerTest.php @@ -83,7 +83,7 @@ class QuickEditImageControllerTest extends BrowserTestBase { // Create a test Node. $node = $this->drupalCreateNode([ 'type' => 'article', - 'title' => t('Test Node'), + 'title' => 'Test Node', ]); $this->drupalGet('quickedit/image/info/node/' . $node->id() . '/' . $this->fieldName . '/' . $node->language()->getId() . '/default'); $this->assertSession()->statusCodeEquals(403); @@ -101,7 +101,7 @@ class QuickEditImageControllerTest extends BrowserTestBase { // Create a test Node. $node = $this->drupalCreateNode([ 'type' => 'article', - 'title' => t('Test Node'), + 'title' => 'Test Node', ]); $json = $this->drupalGet('quickedit/image/info/node/' . $node->id() . '/' . $this->fieldName . '/' . $node->language()->getId() . '/default', ['query' => ['_format' => 'json']]); $info = Json::decode($json); @@ -118,7 +118,7 @@ class QuickEditImageControllerTest extends BrowserTestBase { // Create a test Node. $node = $this->drupalCreateNode([ 'type' => 'article', - 'title' => t('Test Node'), + 'title' => 'Test Node', ]); // We want a test image that is a valid size. @@ -145,7 +145,7 @@ class QuickEditImageControllerTest extends BrowserTestBase { // Create a test Node. $node = $this->drupalCreateNode([ 'type' => 'article', - 'title' => t('Test Node'), + 'title' => 'Test Node', ]); // We want a test image that will fail validation. diff --git a/core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php b/core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php index 2d48df5b66c..daa5a192c4d 100644 --- a/core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php +++ b/core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php @@ -70,7 +70,7 @@ class LayoutBuilderQuickEditTest extends QuickEditJavascriptTestBase { $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); $this->article = $this->drupalCreateNode([ 'type' => 'article', - 'title' => t('My Test Node'), + 'title' => 'My Test Node', 'body' => [ 'value' => 'Hello Layout Builder!', 'format' => 'plain_text', diff --git a/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditFileTest.php b/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditFileTest.php index f6a12e36073..53fad46e43b 100644 --- a/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditFileTest.php +++ b/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditFileTest.php @@ -70,7 +70,7 @@ class QuickEditFileTest extends QuickEditJavascriptTestBase { // Create test node. $node = $this->drupalCreateNode([ 'type' => 'article', - 'title' => t('My Test Node'), + 'title' => 'My Test Node', 'field_file' => [ 'target_id' => $file->id(), ], diff --git a/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditImageTest.php b/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditImageTest.php index 198ddf52dda..7ed59096524 100644 --- a/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditImageTest.php +++ b/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditImageTest.php @@ -104,7 +104,7 @@ class QuickEditImageTest extends QuickEditJavascriptTestBase { $image = $image_factory->get($valid_images[0]->uri); $node = $this->drupalCreateNode([ 'type' => 'article', - 'title' => t('Test Node'), + 'title' => 'Test Node', $field_name => [ 'target_id' => $file->id(), 'alt' => 'Hello world', diff --git a/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditIntegrationTest.php b/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditIntegrationTest.php index 3669dfa9256..2ee31915478 100644 --- a/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditIntegrationTest.php +++ b/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditIntegrationTest.php @@ -127,7 +127,7 @@ class QuickEditIntegrationTest extends QuickEditJavascriptTestBase { $node = $this->drupalCreateNode([ 'type' => 'article', - 'title' => t('My Test Node'), + 'title' => 'My Test Node', 'body' => [ 'value' => '

Hello world!

I do not know what to say…

I wish I were eloquent.

', 'format' => 'some_format', diff --git a/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditLoadingTest.php b/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditLoadingTest.php index 86e95b75e67..18e59f1b46e 100644 --- a/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditLoadingTest.php +++ b/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditLoadingTest.php @@ -354,7 +354,7 @@ class QuickEditLoadingTest extends WebDriverTestBase { FieldConfig::create([ 'field_name' => 'field_image', 'field_type' => 'image', - 'label' => t('Image'), + 'label' => 'Image', 'entity_type' => 'node', 'bundle' => 'article', ])->save(); diff --git a/core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php b/core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php index b6e924bd3ed..bcafe2c4b23 100644 --- a/core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php +++ b/core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php @@ -54,7 +54,7 @@ class ShortcutCacheTagsTest extends EntityCacheTagsTestBase { // Create a "Llama" shortcut. $shortcut = Shortcut::create([ 'shortcut_set' => 'default', - 'title' => t('Llama'), + 'title' => 'Llama', 'weight' => 0, 'link' => [['uri' => 'internal:/admin']], ]); diff --git a/core/modules/statistics/tests/src/Functional/StatisticsTokenReplaceTest.php b/core/modules/statistics/tests/src/Functional/StatisticsTokenReplaceTest.php index 160650bc614..879f16cc90b 100644 --- a/core/modules/statistics/tests/src/Functional/StatisticsTokenReplaceTest.php +++ b/core/modules/statistics/tests/src/Functional/StatisticsTokenReplaceTest.php @@ -36,7 +36,7 @@ class StatisticsTokenReplaceTest extends StatisticsTestBase { $tests = []; $tests['[node:total-count]'] = 0; $tests['[node:day-count]'] = 0; - $tests['[node:last-view]'] = t('never'); + $tests['[node:last-view]'] = 'never'; $tests['[node:last-view:short]'] = $date_formatter->format($request_time, 'short'); foreach ($tests as $input => $expected) { diff --git a/core/modules/system/tests/src/Functional/Database/SelectTableSortDefaultTest.php b/core/modules/system/tests/src/Functional/Database/SelectTableSortDefaultTest.php index f38ea7a2fca..6d20a2e4cb1 100644 --- a/core/modules/system/tests/src/Functional/Database/SelectTableSortDefaultTest.php +++ b/core/modules/system/tests/src/Functional/Database/SelectTableSortDefaultTest.php @@ -24,10 +24,10 @@ class SelectTableSortDefaultTest extends DatabaseTestBase { */ public function testTableSortQuery() { $sorts = [ - ['field' => t('Task ID'), 'sort' => 'desc', 'first' => 'perform at superbowl', 'last' => 'eat'], - ['field' => t('Task ID'), 'sort' => 'asc', 'first' => 'eat', 'last' => 'perform at superbowl'], - ['field' => t('Task'), 'sort' => 'asc', 'first' => 'code', 'last' => 'sleep'], - ['field' => t('Task'), 'sort' => 'desc', 'first' => 'sleep', 'last' => 'code'], + ['field' => 'Task ID', 'sort' => 'desc', 'first' => 'perform at superbowl', 'last' => 'eat'], + ['field' => 'Task ID', 'sort' => 'asc', 'first' => 'eat', 'last' => 'perform at superbowl'], + ['field' => 'Task', 'sort' => 'asc', 'first' => 'code', 'last' => 'sleep'], + ['field' => 'Task', 'sort' => 'desc', 'first' => 'sleep', 'last' => 'code'], // more elements here ]; @@ -52,10 +52,10 @@ class SelectTableSortDefaultTest extends DatabaseTestBase { */ public function testTableSortQueryFirst() { $sorts = [ - ['field' => t('Task ID'), 'sort' => 'desc', 'first' => 'perform at superbowl', 'last' => 'eat'], - ['field' => t('Task ID'), 'sort' => 'asc', 'first' => 'eat', 'last' => 'perform at superbowl'], - ['field' => t('Task'), 'sort' => 'asc', 'first' => 'code', 'last' => 'sleep'], - ['field' => t('Task'), 'sort' => 'desc', 'first' => 'sleep', 'last' => 'code'], + ['field' => 'Task ID', 'sort' => 'desc', 'first' => 'perform at superbowl', 'last' => 'eat'], + ['field' => 'Task ID', 'sort' => 'asc', 'first' => 'eat', 'last' => 'perform at superbowl'], + ['field' => 'Task', 'sort' => 'asc', 'first' => 'code', 'last' => 'sleep'], + ['field' => 'Task', 'sort' => 'desc', 'first' => 'sleep', 'last' => 'code'], // more elements here ]; diff --git a/core/modules/system/tests/src/Functional/Form/ElementsTableSelectTest.php b/core/modules/system/tests/src/Functional/Form/ElementsTableSelectTest.php index 76be86fcac4..f20a753b719 100644 --- a/core/modules/system/tests/src/Functional/Form/ElementsTableSelectTest.php +++ b/core/modules/system/tests/src/Functional/Form/ElementsTableSelectTest.php @@ -216,7 +216,7 @@ class ElementsTableSelectTest extends BrowserTestBase { $form_id = $this->randomMachineName(); $form_state = new FormState(); - $form['op'] = ['#type' => 'submit', '#value' => t('Submit')]; + $form['op'] = ['#type' => 'submit', '#value' => 'Submit']; // The form token CSRF protection should not interfere with this test, so we // bypass it by setting the token to FALSE. $form['#token'] = FALSE; diff --git a/core/modules/system/tests/src/Functional/Form/FormTest.php b/core/modules/system/tests/src/Functional/Form/FormTest.php index 47416c0dba3..860ff8dd007 100644 --- a/core/modules/system/tests/src/Functional/Form/FormTest.php +++ b/core/modules/system/tests/src/Functional/Form/FormTest.php @@ -85,7 +85,7 @@ class FormTest extends BrowserTestBase { $elements['textarea']['element'] = ['#title' => $this->randomMachineName(), '#type' => 'textarea']; $elements['textarea']['empty_values'] = $empty_strings; - $elements['radios']['element'] = ['#title' => $this->randomMachineName(), '#type' => 'radios', '#options' => ['' => t('None'), $this->randomMachineName(), $this->randomMachineName(), $this->randomMachineName()]]; + $elements['radios']['element'] = ['#title' => $this->randomMachineName(), '#type' => 'radios', '#options' => ['' => 'None', $this->randomMachineName(), $this->randomMachineName(), $this->randomMachineName()]]; $elements['radios']['empty_values'] = $empty_arrays; $elements['checkbox']['element'] = ['#title' => $this->randomMachineName(), '#type' => 'checkbox', '#required' => TRUE]; @@ -94,7 +94,7 @@ class FormTest extends BrowserTestBase { $elements['checkboxes']['element'] = ['#title' => $this->randomMachineName(), '#type' => 'checkboxes', '#options' => [$this->randomMachineName(), $this->randomMachineName(), $this->randomMachineName()]]; $elements['checkboxes']['empty_values'] = $empty_arrays; - $elements['select']['element'] = ['#title' => $this->randomMachineName(), '#type' => 'select', '#options' => ['' => t('None'), $this->randomMachineName(), $this->randomMachineName(), $this->randomMachineName()]]; + $elements['select']['element'] = ['#title' => $this->randomMachineName(), '#type' => 'select', '#options' => ['' => 'None', $this->randomMachineName(), $this->randomMachineName(), $this->randomMachineName()]]; $elements['select']['empty_values'] = $empty_strings; $elements['file']['element'] = ['#title' => $this->randomMachineName(), '#type' => 'file']; @@ -109,7 +109,7 @@ class FormTest extends BrowserTestBase { $form_id = $this->randomMachineName(); $form = []; $form_state = new FormState(); - $form['op'] = ['#type' => 'submit', '#value' => t('Submit')]; + $form['op'] = ['#type' => 'submit', '#value' => 'Submit']; $element = $data['element']['#title']; $form[$element] = $data['element']; $form[$element]['#required'] = $required; @@ -185,7 +185,7 @@ class FormTest extends BrowserTestBase { $expected[] = $form[$key]['#form_test_required_error']; } else { - $expected[] = t('@name field is required.', ['@name' => $form[$key]['#title']]); + $expected[] = $form[$key]['#title'] . ' field is required.'; } } diff --git a/core/modules/system/tests/src/Functional/Form/LanguageSelectElementTest.php b/core/modules/system/tests/src/Functional/Form/LanguageSelectElementTest.php index 02331c47c7a..fa623992416 100644 --- a/core/modules/system/tests/src/Functional/Form/LanguageSelectElementTest.php +++ b/core/modules/system/tests/src/Functional/Form/LanguageSelectElementTest.php @@ -58,7 +58,7 @@ class LanguageSelectElementTest extends BrowserTestBase { /** @var \Drupal\Core\Language\LanguageManagerInterface $language_manager */ $language_manager = $this->container->get('language_manager'); foreach ($language_manager->getLanguages($flags) as $langcode => $language) { - $options[$langcode] = $language->isLocked() ? t('- @name -', ['@name' => $language->getName()]) : $language->getName(); + $options[$langcode] = $language->isLocked() ? "- {$language->getName()} -" : $language->getName(); } $this->_testLanguageSelectElementOptions($id, $options); } diff --git a/core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php b/core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php index 849399fd230..12461125711 100644 --- a/core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php +++ b/core/modules/system/tests/src/Functional/Menu/BreadcrumbTest.php @@ -68,62 +68,62 @@ class BreadcrumbTest extends BrowserTestBase { public function testBreadCrumbs() { // Prepare common base breadcrumb elements. $home = ['' => 'Home']; - $admin = $home + ['admin' => t('Administration')]; - $config = $admin + ['admin/config' => t('Configuration')]; + $admin = $home + ['admin' => 'Administration']; + $config = $admin + ['admin/config' => 'Configuration']; $type = 'article'; // Verify Taxonomy administration breadcrumbs. $trail = $admin + [ - 'admin/structure' => t('Structure'), + 'admin/structure' => 'Structure', ]; $this->assertBreadcrumb('admin/structure/taxonomy', $trail); $trail += [ - 'admin/structure/taxonomy' => t('Taxonomy'), + 'admin/structure/taxonomy' => 'Taxonomy', ]; $this->assertBreadcrumb('admin/structure/taxonomy/manage/tags', $trail); $trail += [ - 'admin/structure/taxonomy/manage/tags' => t('Edit Tags'), + 'admin/structure/taxonomy/manage/tags' => 'Edit Tags', ]; $this->assertBreadcrumb('admin/structure/taxonomy/manage/tags/overview', $trail); $this->assertBreadcrumb('admin/structure/taxonomy/manage/tags/add', $trail); // Verify Menu administration breadcrumbs. $trail = $admin + [ - 'admin/structure' => t('Structure'), + 'admin/structure' => 'Structure', ]; $this->assertBreadcrumb('admin/structure/menu', $trail); $trail += [ - 'admin/structure/menu' => t('Menus'), + 'admin/structure/menu' => 'Menus', ]; $this->assertBreadcrumb('admin/structure/menu/manage/tools', $trail); $trail += [ - 'admin/structure/menu/manage/tools' => t('Tools'), + 'admin/structure/menu/manage/tools' => 'Tools', ]; $this->assertBreadcrumb("admin/structure/menu/link/node.add_page/edit", $trail); $this->assertBreadcrumb('admin/structure/menu/manage/tools/add', $trail); // Verify Node administration breadcrumbs. $trail = $admin + [ - 'admin/structure' => t('Structure'), - 'admin/structure/types' => t('Content types'), + 'admin/structure' => 'Structure', + 'admin/structure/types' => 'Content types', ]; $this->assertBreadcrumb('admin/structure/types/add', $trail); $this->assertBreadcrumb("admin/structure/types/manage/$type", $trail); $trail += [ - "admin/structure/types/manage/$type" => t('Article'), + "admin/structure/types/manage/$type" => 'Article', ]; $this->assertBreadcrumb("admin/structure/types/manage/$type/fields", $trail); $this->assertBreadcrumb("admin/structure/types/manage/$type/display", $trail); $trail_teaser = $trail + [ - "admin/structure/types/manage/$type/display" => t('Manage display'), + "admin/structure/types/manage/$type/display" => 'Manage display', ]; $this->assertBreadcrumb("admin/structure/types/manage/$type/display/teaser", $trail_teaser); $this->assertBreadcrumb("admin/structure/types/manage/$type/delete", $trail); $trail += [ - "admin/structure/types/manage/$type/fields" => t('Manage fields'), + "admin/structure/types/manage/$type/fields" => 'Manage fields', ]; $this->assertBreadcrumb("admin/structure/types/manage/$type/fields/node.$type.body", $trail); @@ -132,12 +132,12 @@ class BreadcrumbTest extends BrowserTestBase { $format = reset($filter_formats); $format_id = $format->id(); $trail = $config + [ - 'admin/config/content' => t('Content authoring'), + 'admin/config/content' => 'Content authoring', ]; $this->assertBreadcrumb('admin/config/content/formats', $trail); $trail += [ - 'admin/config/content/formats' => t('Text formats and editors'), + 'admin/config/content/formats' => 'Text formats and editors', ]; $this->assertBreadcrumb('admin/config/content/formats/add', $trail); $this->assertBreadcrumb("admin/config/content/formats/manage/$format_id", $trail); @@ -379,7 +379,7 @@ class BreadcrumbTest extends BrowserTestBase { $this->assertSession()->statusCodeNotEquals(403); // Since the Reports page is accessible, that will show. - $trail += ['admin/reports' => t('Reports')]; + $trail += ['admin/reports' => 'Reports']; $this->assertBreadcrumb('admin/reports/dblog', $trail, 'Recent log messages'); $this->assertSession()->statusCodeNotEquals(403); @@ -395,7 +395,7 @@ class BreadcrumbTest extends BrowserTestBase { public function testAssertBreadcrumbTrait() { // Ensure the test trait works as expected using menu_test routes. $home = ['' => 'Home']; - $trail = $home + ['menu-test' => t('Menu test root')]; + $trail = $home + ['menu-test' => 'Menu test root']; // Test a passing assertion. $this->assertBreadcrumb('menu-test/breadcrumb1', $trail); diff --git a/core/modules/system/tests/src/Functional/System/SiteMaintenanceTest.php b/core/modules/system/tests/src/Functional/System/SiteMaintenanceTest.php index 1400fb0561e..0503da1715e 100644 --- a/core/modules/system/tests/src/Functional/System/SiteMaintenanceTest.php +++ b/core/modules/system/tests/src/Functional/System/SiteMaintenanceTest.php @@ -54,12 +54,12 @@ class SiteMaintenanceTest extends BrowserTestBase { public function testSiteMaintenance() { // Verify that permission message is displayed. - $permission_handler = $this->container->get('user.permissions'); - $permissions = $permission_handler->getPermissions(); - $permission_label = $permissions['access site in maintenance mode']['title']; - $permission_message = t('Visitors will only see the maintenance mode message. Only users with the "@permission-label" permission will be able to access the site. Authorized users can log in directly via the user login page.', ['@permission-label' => $permission_label, ':permissions-url' => Url::fromRoute('user.admin_permissions')->toString(), ':user-login' => Url::fromRoute('user.login')->toString()]); $this->drupalGet(Url::fromRoute('system.site_maintenance_mode')); - $this->assertSession()->responseContains($permission_message); + $this->assertSession()->pageTextContains('Visitors will only see the maintenance mode message. Only users with the "Use the site in maintenance mode" permission will be able to access the site. Authorized users can log in directly via the user login page.'); + $this->assertSession()->linkExists('permission'); + $this->assertSession()->linkByHrefExists(Url::fromRoute('user.admin_permissions')->toString()); + $this->assertSession()->linkExists('user login'); + $this->assertSession()->linkByHrefExists(Url::fromRoute('user.login')->toString()); $this->drupalGet(Url::fromRoute('user.page')); // JS should be aggregated, so drupal.js is not in the page source. @@ -72,7 +72,7 @@ class SiteMaintenanceTest extends BrowserTestBase { $this->drupalGet('admin/config/development/maintenance'); $this->submitForm($edit, 'Save configuration'); - $admin_message = t('Operating in maintenance mode. Go online.', [':url' => Url::fromRoute('system.site_maintenance_mode')->toString()]); + $admin_message = 'Operating in maintenance mode. Go online.'; $user_message = 'Operating in maintenance mode.'; $offline_message = $this->config('system.site')->get('name') . ' is currently under maintenance. We should be back shortly. Thank you for your patience.'; @@ -80,7 +80,9 @@ class SiteMaintenanceTest extends BrowserTestBase { // JS should not be aggregated, so drupal.js is expected in the page source. $links = $this->xpath('//script[contains(@src, :href)]', [':href' => '/core/misc/drupal.js']); $this->assertTrue(isset($links[0]), 'script /core/misc/drupal.js in page'); - $this->assertSession()->responseContains($admin_message); + $this->assertSession()->pageTextContains($admin_message); + $this->assertSession()->linkExists('Go online.'); + $this->assertSession()->linkByHrefExists(Url::fromRoute('system.site_maintenance_mode')->toString()); // Logout and verify that offline message is displayed. $this->drupalLogout(); @@ -113,7 +115,7 @@ class SiteMaintenanceTest extends BrowserTestBase { $this->drupalLogout(); $this->drupalLogin($this->adminUser); $this->drupalGet('admin/config/development/maintenance'); - $this->assertSession()->responseNotContains($admin_message); + $this->assertSession()->pageTextNotContains($admin_message); $offline_message = 'Sorry, not online.'; $edit = [ diff --git a/core/modules/system/tests/src/Kernel/Action/ActionTest.php b/core/modules/system/tests/src/Kernel/Action/ActionTest.php index 47d39cdbd24..2dac37555ce 100644 --- a/core/modules/system/tests/src/Kernel/Action/ActionTest.php +++ b/core/modules/system/tests/src/Kernel/Action/ActionTest.php @@ -80,7 +80,7 @@ class ActionTest extends KernelTestBase { $action = Action::create([ 'id' => 'user_add_role_action.' . RoleInterface::ANONYMOUS_ID, 'type' => 'user', - 'label' => t('Add the anonymous role to the selected users'), + 'label' => 'Add the anonymous role to the selected users', 'configuration' => [ 'rid' => RoleInterface::ANONYMOUS_ID, ], diff --git a/core/modules/system/tests/src/Kernel/Form/ProgrammaticTest.php b/core/modules/system/tests/src/Kernel/Form/ProgrammaticTest.php index c924b55676f..4cb67b5425e 100644 --- a/core/modules/system/tests/src/Kernel/Form/ProgrammaticTest.php +++ b/core/modules/system/tests/src/Kernel/Form/ProgrammaticTest.php @@ -76,7 +76,7 @@ class ProgrammaticTest extends KernelTestBase { $valid_form = empty($errors); $args = [ '%values' => print_r($values, TRUE), - '%errors' => $valid_form ? t('None') : implode(' ', $errors), + '%errors' => $valid_form ? 'None' : implode(' ', $errors), ]; $this->assertSame($valid_form, $valid_input, new FormattableMarkup('Input values: %values
Validation handler errors: %errors', $args)); diff --git a/core/modules/taxonomy/tests/src/Functional/VocabularyPermissionsTest.php b/core/modules/taxonomy/tests/src/Functional/VocabularyPermissionsTest.php index c96ec87df6e..1794ecde34c 100644 --- a/core/modules/taxonomy/tests/src/Functional/VocabularyPermissionsTest.php +++ b/core/modules/taxonomy/tests/src/Functional/VocabularyPermissionsTest.php @@ -73,8 +73,9 @@ class VocabularyPermissionsTest extends TaxonomyTestBase { $this->createTerm($vocabulary1); // Assert expected help texts on first vocabulary. - $edit_help_text = t('You can reorganize the terms in @capital_name using their drag-and-drop handles, and group terms under a parent term by sliding them under and to the right of the parent.', ['@capital_name' => Unicode::ucfirst($vocabulary1->label())]); - $no_edit_help_text = t('@capital_name contains the following terms.', ['@capital_name' => Unicode::ucfirst($vocabulary1->label())]); + $vocabulary1_label = Unicode::ucfirst($vocabulary1->label()); + $edit_help_text = "You can reorganize the terms in $vocabulary1_label using their drag-and-drop handles, and group terms under a parent term by sliding them under and to the right of the parent."; + $no_edit_help_text = "$vocabulary1_label contains the following terms."; $assert_session = $this->assertSession(); diff --git a/core/modules/taxonomy/tests/src/Functional/VocabularyTranslationTest.php b/core/modules/taxonomy/tests/src/Functional/VocabularyTranslationTest.php index 9bcf06075f5..4eb7cecce8b 100644 --- a/core/modules/taxonomy/tests/src/Functional/VocabularyTranslationTest.php +++ b/core/modules/taxonomy/tests/src/Functional/VocabularyTranslationTest.php @@ -87,7 +87,7 @@ class VocabularyTranslationTest extends TaxonomyTestBase { $edit['langcode'] = 'en'; $edit['vid'] = $vid; $edit['default_language[content_translation]'] = TRUE; - $this->submitForm($edit, t('Save')); + $this->submitForm($edit, 'Save'); $langcode = $this->additionalLangcodes[0]; $vid_name = $edit['name']; @@ -100,7 +100,7 @@ class VocabularyTranslationTest extends TaxonomyTestBase { $this->drupalGet("admin/structure/taxonomy/manage/$vid/translate/$langcode/add"); // Translate the name label. - $this->submitForm(["translation[config_names][taxonomy.vocabulary.$vid][name]" => $translated_vid_name], t('Save translation')); + $this->submitForm(["translation[config_names][taxonomy.vocabulary.$vid][name]" => $translated_vid_name], 'Save translation'); // Assert that the right name label is displayed on the taxonomy term // overview page. diff --git a/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php b/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php index e3921eb0307..e06fd4cd14c 100644 --- a/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php +++ b/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php @@ -50,7 +50,7 @@ class TrackerNodeAccessTest extends BrowserTestBase { // queries run for the anonymous user will miss it. $author = $this->drupalCreateUser(); $private_node = $this->drupalCreateNode([ - 'title' => t('Private node test'), + 'title' => 'Private node test', 'private' => TRUE, 'uid' => $author->id(), ]); @@ -85,11 +85,11 @@ class TrackerNodeAccessTest extends BrowserTestBase { // Create some nodes. $private_node = $this->drupalCreateNode([ - 'title' => t('Private node test'), + 'title' => 'Private node test', 'private' => TRUE, ]); $public_node = $this->drupalCreateNode([ - 'title' => t('Public node test'), + 'title' => 'Public node test', 'private' => FALSE, ]); diff --git a/core/modules/user/tests/src/Functional/UserAdminTest.php b/core/modules/user/tests/src/Functional/UserAdminTest.php index ae93524c788..8fedf64f7c0 100644 --- a/core/modules/user/tests/src/Functional/UserAdminTest.php +++ b/core/modules/user/tests/src/Functional/UserAdminTest.php @@ -75,7 +75,7 @@ class UserAdminTest extends BrowserTestBase { $this->assertSession()->pageTextContains($admin_user->getAccountName()); // Test for existence of edit link in table. - $link = $user_a->toLink(t('Edit'), 'edit-form', ['query' => ['destination' => $user_a->toUrl('collection')->toString()]])->toString(); + $link = $user_a->toLink('Edit', 'edit-form', ['query' => ['destination' => $user_a->toUrl('collection')->toString()]])->toString(); $this->assertSession()->responseContains($link); // Test exposed filter elements. diff --git a/core/modules/user/tests/src/Functional/UserCreateTest.php b/core/modules/user/tests/src/Functional/UserCreateTest.php index b87998ff83f..dee27b7054d 100644 --- a/core/modules/user/tests/src/Functional/UserCreateTest.php +++ b/core/modules/user/tests/src/Functional/UserCreateTest.php @@ -61,7 +61,7 @@ class UserCreateTest extends BrowserTestBase { 'entity_type' => 'user', 'label' => 'Picture', 'bundle' => 'user', - 'description' => t('Your virtual face or picture.'), + 'description' => 'Your virtual face or picture.', 'required' => FALSE, 'settings' => [ 'file_extensions' => 'png gif jpg jpeg', diff --git a/core/modules/user/tests/src/Functional/UserPasswordResetTest.php b/core/modules/user/tests/src/Functional/UserPasswordResetTest.php index 515a149f484..31c0db9ed3d 100644 --- a/core/modules/user/tests/src/Functional/UserPasswordResetTest.php +++ b/core/modules/user/tests/src/Functional/UserPasswordResetTest.php @@ -490,7 +490,7 @@ class UserPasswordResetTest extends BrowserTestBase { public function assertValidPasswordReset($name) { $this->assertSession()->pageTextContains("If $name is a valid account, an email will be sent with instructions to reset your password."); $this->assertMail('to', $this->account->getEmail(), 'Password e-mail sent to user.'); - $subject = t('Replacement login information for @username at @site', ['@username' => $this->account->getAccountName(), '@site' => \Drupal::config('system.site')->get('name')]); + $subject = 'Replacement login information for ' . $this->account->getAccountName() . ' at Drupal'; $this->assertMail('subject', $subject, 'Password reset e-mail subject is correct.'); } diff --git a/core/modules/user/tests/src/Functional/UserTokenReplaceTest.php b/core/modules/user/tests/src/Functional/UserTokenReplaceTest.php index 7a3f5ca34c5..4ea4a29c89c 100644 --- a/core/modules/user/tests/src/Functional/UserTokenReplaceTest.php +++ b/core/modules/user/tests/src/Functional/UserTokenReplaceTest.php @@ -118,7 +118,7 @@ class UserTokenReplaceTest extends BrowserTestBase { // Generate tokens for the anonymous user. $anonymous_user = User::load(0); $tests = []; - $tests['[user:uid]'] = t('not yet assigned'); + $tests['[user:uid]'] = 'not yet assigned'; $tests['[user:display-name]'] = $anonymous_user->getDisplayName(); $base_bubbleable_metadata = BubbleableMetadata::createFromObject($anonymous_user); diff --git a/core/modules/user/tests/src/FunctionalJavascript/RegistrationWithUserFieldsTest.php b/core/modules/user/tests/src/FunctionalJavascript/RegistrationWithUserFieldsTest.php index 988a9b88be8..da488b75984 100644 --- a/core/modules/user/tests/src/FunctionalJavascript/RegistrationWithUserFieldsTest.php +++ b/core/modules/user/tests/src/FunctionalJavascript/RegistrationWithUserFieldsTest.php @@ -94,7 +94,7 @@ class RegistrationWithUserFieldsTest extends WebDriverTestBase { $this->page->fillField('edit-mail', $name . '@example.com'); $this->page->pressButton('edit-submit'); - $this->webAssert->pageTextContains(t('@name field is required.', ['@name' => $field->label()])); + $this->webAssert->pageTextContains($field->label() . ' field is required.'); // Invalid input. $this->page->fillField('edit-test-user-field-0-value', '-1'); diff --git a/core/modules/user/tests/src/Kernel/Views/HandlerFieldPermissionTest.php b/core/modules/user/tests/src/Kernel/Views/HandlerFieldPermissionTest.php index 1cfe12f8a07..37ff151b28a 100644 --- a/core/modules/user/tests/src/Kernel/Views/HandlerFieldPermissionTest.php +++ b/core/modules/user/tests/src/Kernel/Views/HandlerFieldPermissionTest.php @@ -34,12 +34,12 @@ class HandlerFieldPermissionTest extends UserKernelTestBase { $expected_permissions = []; $expected_permissions[$this->users[0]->id()] = []; $expected_permissions[$this->users[1]->id()] = []; - $expected_permissions[$this->users[2]->id()][] = t('Administer roles and permissions'); + $expected_permissions[$this->users[2]->id()][] = 'Administer roles and permissions'; // View user profiles comes first, because we sort by the permission // machine name. - $expected_permissions[$this->users[3]->id()][] = t('View user information'); - $expected_permissions[$this->users[3]->id()][] = t('Administer roles and permissions'); - $expected_permissions[$this->users[3]->id()][] = t('Administer users'); + $expected_permissions[$this->users[3]->id()][] = 'View user information'; + $expected_permissions[$this->users[3]->id()][] = 'Administer roles and permissions'; + $expected_permissions[$this->users[3]->id()][] = 'Administer users'; foreach ($view->result as $index => $row) { $uid = $view->field['uid']->getValue($row); diff --git a/core/modules/views/tests/src/Functional/Handler/HandlerTest.php b/core/modules/views/tests/src/Functional/Handler/HandlerTest.php index 47f8015ff5f..2ac51567d82 100644 --- a/core/modules/views/tests/src/Functional/Handler/HandlerTest.php +++ b/core/modules/views/tests/src/Functional/Handler/HandlerTest.php @@ -79,41 +79,41 @@ class HandlerTest extends ViewTestBase { // Test ors $handler = HandlerBase::breakString('word1 word2+word'); - $this->assertEqualValue(['word1', 'word2', 'word'], $handler); + $this->assertEquals(['word1', 'word2', 'word'], $handler->value); $this->assertEquals('or', $handler->operator); $handler = HandlerBase::breakString('word1+word2+word'); - $this->assertEqualValue(['word1', 'word2', 'word'], $handler); + $this->assertEquals(['word1', 'word2', 'word'], $handler->value); $this->assertEquals('or', $handler->operator); $handler = HandlerBase::breakString('word1 word2 word'); - $this->assertEqualValue(['word1', 'word2', 'word'], $handler); + $this->assertEquals(['word1', 'word2', 'word'], $handler->value); $this->assertEquals('or', $handler->operator); $handler = HandlerBase::breakString('word-1+word-2+word'); - $this->assertEqualValue(['word-1', 'word-2', 'word'], $handler); + $this->assertEquals(['word-1', 'word-2', 'word'], $handler->value); $this->assertEquals('or', $handler->operator); $handler = HandlerBase::breakString('wõrd1+wõrd2+wõrd'); - $this->assertEqualValue(['wõrd1', 'wõrd2', 'wõrd'], $handler); + $this->assertEquals(['wõrd1', 'wõrd2', 'wõrd'], $handler->value); $this->assertEquals('or', $handler->operator); // Test ands. $handler = HandlerBase::breakString('word1,word2,word'); - $this->assertEqualValue(['word1', 'word2', 'word'], $handler); + $this->assertEquals(['word1', 'word2', 'word'], $handler->value); $this->assertEquals('and', $handler->operator); $handler = HandlerBase::breakString('word1 word2,word'); - $this->assertEqualValue(['word1 word2', 'word'], $handler); + $this->assertEquals(['word1 word2', 'word'], $handler->value); $this->assertEquals('and', $handler->operator); $handler = HandlerBase::breakString('word1,word2 word'); - $this->assertEqualValue(['word1', 'word2 word'], $handler); + $this->assertEquals(['word1', 'word2 word'], $handler->value); $this->assertEquals('and', $handler->operator); $handler = HandlerBase::breakString('word-1,word-2,word'); - $this->assertEqualValue(['word-1', 'word-2', 'word'], $handler); + $this->assertEquals(['word-1', 'word-2', 'word'], $handler->value); $this->assertEquals('and', $handler->operator); $handler = HandlerBase::breakString('wõrd1,wõrd2,wõrd'); - $this->assertEqualValue(['wõrd1', 'wõrd2', 'wõrd'], $handler); + $this->assertEquals(['wõrd1', 'wõrd2', 'wõrd'], $handler->value); $this->assertEquals('and', $handler->operator); // Test a single word $handler = HandlerBase::breakString('word'); - $this->assertEqualValue(['word'], $handler); + $this->assertEquals(['word'], $handler->value); $this->assertEquals('and', $handler->operator); $s1 = $this->randomMachineName(); @@ -124,45 +124,45 @@ class HandlerTest extends ViewTestBase { // Test "or"s. $handlerBase = HandlerBase::breakString("$s1 $n2+$n3"); - $this->assertEqualValue([$s1, $n2, $n3], $handlerBase); + $this->assertEquals([$s1, $n2, $n3], $handlerBase->value); $this->assertEquals('or', $handlerBase->operator); $handlerBase = HandlerBase::breakString("$s1+$n2+$n3"); - $this->assertEqualValue([$s1, $n2, $n3], $handlerBase); + $this->assertEquals([$s1, $n2, $n3], $handlerBase->value); $this->assertEquals('or', $handlerBase->operator); $handlerBase = HandlerBase::breakString("$s1 $n2 $n3"); - $this->assertEqualValue([$s1, $n2, $n3], $handlerBase); + $this->assertEquals([$s1, $n2, $n3], $handlerBase->value); $this->assertEquals('or', $handlerBase->operator); $handlerBase = HandlerBase::breakString("$s1 $n2++$n3"); - $this->assertEqualValue([$s1, $n2, $n3], $handlerBase); + $this->assertEquals([$s1, $n2, $n3], $handlerBase->value); $this->assertEquals('or', $handlerBase->operator); // Test "and"s. $handlerBase = HandlerBase::breakString("$s1,$n2,$n3"); - $this->assertEqualValue([$s1, $n2, $n3], $handlerBase); + $this->assertEquals([$s1, $n2, $n3], $handlerBase->value); $this->assertEquals('and', $handlerBase->operator); $handlerBase = HandlerBase::breakString("$s1,,$n2,$n3"); - $this->assertEqualValue([$s1, $n2, $n3], $handlerBase); + $this->assertEquals([$s1, $n2, $n3], $handlerBase->value); $this->assertEquals('and', $handlerBase->operator); // Enforce int values. $handlerBase = HandlerBase::breakString("$n1,$n2,$n3", TRUE); - $this->assertEqualValue([$n1, $n2, $n3], $handlerBase); + $this->assertEquals([$n1, $n2, $n3], $handlerBase->value); $this->assertEquals('and', $handlerBase->operator); $handlerBase = HandlerBase::breakString("$n1+$n2+$n3", TRUE); - $this->assertEqualValue([$n1, $n2, $n3], $handlerBase); + $this->assertEquals([$n1, $n2, $n3], $handlerBase->value); $this->assertEquals('or', $handlerBase->operator); $handlerBase = HandlerBase::breakString("$s1,$n2,$n3", TRUE); - $this->assertEqualValue([(int) $s1, $n2, $n3], $handlerBase); + $this->assertEquals([(int) $s1, $n2, $n3], $handlerBase->value); $this->assertEquals('and', $handlerBase->operator); $handlerBase = HandlerBase::breakString("$s1+$n2+$n3", TRUE); - $this->assertEqualValue([(int) $s1, $n2, $n3], $handlerBase); + $this->assertEquals([(int) $s1, $n2, $n3], $handlerBase->value); $this->assertEquals('or', $handlerBase->operator); // Generate three random decimals which can be used below; @@ -172,28 +172,28 @@ class HandlerTest extends ViewTestBase { // Test "or"s. $handlerBase = HandlerBase::breakString("$s1 $d1+$d2"); - $this->assertEqualValue([$s1, $d1, $d2], $handlerBase); + $this->assertEquals([$s1, $d1, $d2], $handlerBase->value); $this->assertEquals('or', $handlerBase->operator); $handlerBase = HandlerBase::breakString("$s1+$d1+$d3"); - $this->assertEqualValue([$s1, $d1, $d3], $handlerBase); + $this->assertEquals([$s1, $d1, $d3], $handlerBase->value); $this->assertEquals('or', $handlerBase->operator); $handlerBase = HandlerBase::breakString("$s1 $d2 $d3"); - $this->assertEqualValue([$s1, $d2, $d3], $handlerBase); + $this->assertEquals([$s1, $d2, $d3], $handlerBase->value); $this->assertEquals('or', $handlerBase->operator); $handlerBase = HandlerBase::breakString("$s1 $d2++$d3"); - $this->assertEqualValue([$s1, $d2, $d3], $handlerBase); + $this->assertEquals([$s1, $d2, $d3], $handlerBase->value); $this->assertEquals('or', $handlerBase->operator); // Test "and"s. $handlerBase = HandlerBase::breakString("$s1,$d2,$d3"); - $this->assertEqualValue([$s1, $d2, $d3], $handlerBase); + $this->assertEquals([$s1, $d2, $d3], $handlerBase->value); $this->assertEquals('and', $handlerBase->operator); $handlerBase = HandlerBase::breakString("$s1,,$d2,$d3"); - $this->assertEqualValue([$s1, $d2, $d3], $handlerBase); + $this->assertEquals([$s1, $d2, $d3], $handlerBase->value); $this->assertEquals('and', $handlerBase->operator); } @@ -223,30 +223,6 @@ class HandlerTest extends ViewTestBase { } } - /** - * Check to see if a value is the same as the value on a certain handler. - * - * @param $expected - * The expected value to check. - * @param \Drupal\views\Plugin\views\ViewsHandlerInterface $handler - * The handler that has the $handler->value property to compare with first. - * @param string $message - * The message to display along with the assertion. - * @param string $group - * The type of assertion - examples are "Browser", "PHP". - * - * @return bool - * TRUE if the assertion succeeded. - */ - protected function assertEqualValue($expected, $handler, $message = '', $group = 'Other') { - if (empty($message)) { - $message = t('Comparing @first and @second', ['@first' => implode(',', $expected), '@second' => implode(',', $handler->value)]); - } - - $this->assertEquals($expected, $handler->value, $message); - return TRUE; - } - /** * Tests the relationship ui for field/filter/argument/relationship. */ diff --git a/core/modules/views/tests/src/Functional/ViewsFormMultipleTest.php b/core/modules/views/tests/src/Functional/ViewsFormMultipleTest.php index 49ed139ae0f..868de09ac6c 100644 --- a/core/modules/views/tests/src/Functional/ViewsFormMultipleTest.php +++ b/core/modules/views/tests/src/Functional/ViewsFormMultipleTest.php @@ -36,8 +36,8 @@ class ViewsFormMultipleTest extends ViewTestBase { protected function viewsData() { $data = parent::viewsData(); $data['views_test_data']['field_form_button_test']['field'] = [ - 'title' => t('Button test'), - 'help' => t('Adds a test form button.'), + 'title' => 'Button test', + 'help' => 'Adds a test form button.', 'id' => 'field_form_button_test', ]; return $data; diff --git a/core/modules/views/tests/src/FunctionalJavascript/ExposedFilterAJAXTest.php b/core/modules/views/tests/src/FunctionalJavascript/ExposedFilterAJAXTest.php index 8f30fb2db1a..24873e674f5 100644 --- a/core/modules/views/tests/src/FunctionalJavascript/ExposedFilterAJAXTest.php +++ b/core/modules/views/tests/src/FunctionalJavascript/ExposedFilterAJAXTest.php @@ -179,7 +179,7 @@ class ExposedFilterAJAXTest extends WebDriverTestBase { $ajax_views_before = $drupal_settings['views']['ajaxViews']; // Search for "Page One". - $this->submitForm(['title' => 'Page One'], t('Filter')); + $this->submitForm(['title' => 'Page One'], 'Filter'); $this->assertSession()->assertWaitOnAjaxRequest(); // Verify that only the "Page One" Node is present. diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldBooleanTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldBooleanTest.php index 5640dbb710e..e3bc2e71dd4 100644 --- a/core/modules/views/tests/src/Kernel/Handler/FieldBooleanTest.php +++ b/core/modules/views/tests/src/Kernel/Handler/FieldBooleanTest.php @@ -70,7 +70,7 @@ class FieldBooleanTest extends ViewsKernelTestBase { $this->assertEquals('✔', $view->field['age']->advancedRender($view->result[1])); // Set a custom output format. - $view->field['age']->formats['test'] = [t('Test-True'), t('Test-False')]; + $view->field['age']->formats['test'] = ['Test-True', 'Test-False']; $view->field['age']->options['type'] = 'test'; $this->assertEquals('Test-False', $view->field['age']->advancedRender($view->result[0])); $this->assertEquals('Test-True', $view->field['age']->advancedRender($view->result[1])); diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldDateTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldDateTest.php index 0b3ddc4f68d..5ce5e83c832 100644 --- a/core/modules/views/tests/src/Kernel/Handler/FieldDateTest.php +++ b/core/modules/views/tests/src/Kernel/Handler/FieldDateTest.php @@ -122,10 +122,10 @@ class FieldDateTest extends ViewsKernelTestBase { $time_since = $date_formatter->formatTimeDiffSince($time); $intervals = [ 'raw time ago' => $time_since, - 'time ago' => t('%time ago', ['%time' => $time_since]), + 'time ago' => "$time_since ago", 'raw time span' => $time_since, 'inverse time span' => "-$time_since", - 'time span' => t('%time ago', ['%time' => $time_since]), + 'time span' => "$time_since ago", ]; $this->assertRenderedDatesEqual($view, $intervals); @@ -134,9 +134,7 @@ class FieldDateTest extends ViewsKernelTestBase { $formatted = $date_formatter->formatTimeDiffUntil($time); $intervals = [ 'raw time span' => "-$formatted", - 'time span' => t('%time hence', [ - '%time' => $formatted, - ]), + 'time span' => "$formatted hence", ]; $this->assertRenderedFutureDatesEqual($view, $intervals); } @@ -154,20 +152,15 @@ class FieldDateTest extends ViewsKernelTestBase { protected function assertRenderedDatesEqual($view, $map, $timezone = NULL) { foreach ($map as $date_format => $expected_result) { $view->field['created']->options['date_format'] = $date_format; - $t_args = [ - '%value' => $expected_result, - '%format' => $date_format, - ]; if (isset($timezone)) { - $t_args['%timezone'] = $timezone; - $message = t('Value %value in %format format for timezone %timezone matches.', $t_args); + $message = "$date_format format for timezone $timezone matches."; $view->field['created']->options['timezone'] = $timezone; } else { - $message = t('Value %value in %format format matches.', $t_args); + $message = "$date_format format matches."; } $actual_result = $view->field['created']->advancedRender($view->result[0]); - $this->assertEquals($expected_result, $actual_result, $message); + $this->assertEquals($expected_result, strip_tags($actual_result), $message); } } @@ -183,13 +176,7 @@ class FieldDateTest extends ViewsKernelTestBase { foreach ($map as $format => $result) { $view->field['destroyed']->options['date_format'] = $format; $view_result = $view->field['destroyed']->advancedRender($view->result[0]); - $t_args = [ - '%value' => $result, - '%format' => $format, - '%actual' => $view_result, - ]; - $message = t('Value %value in %format matches %actual', $t_args); - $this->assertEquals($result, $view_result, $message); + $this->assertEquals($result, strip_tags($view_result), "$format format matches."); } } diff --git a/core/modules/views/tests/src/Kernel/ModuleTest.php b/core/modules/views/tests/src/Kernel/ModuleTest.php index 55fe86c0022..f59370d62d0 100644 --- a/core/modules/views/tests/src/Kernel/ModuleTest.php +++ b/core/modules/views/tests/src/Kernel/ModuleTest.php @@ -175,7 +175,7 @@ class ModuleTest extends ViewsKernelTestBase { $expected_opt_groups = []; foreach ($all_views as $view) { foreach ($view->get('display') as $display) { - $expected_opt_groups[$view->id()][$view->id() . ':' . $display['id']] = (string) t('@view : @display', ['@view' => $view->id(), '@display' => $display['id']]); + $expected_opt_groups[$view->id()][$view->id() . ':' . $display['id']] = $view->id() . ' : ' . $display['id']; } } $this->assertEquals($expected_opt_groups, Views::getViewsAsOptions(FALSE, 'all', NULL, TRUE), 'Expected option array for an option group returned.'); @@ -325,8 +325,7 @@ class ModuleTest extends ViewsKernelTestBase { $expected_options = []; foreach ($views as $view) { foreach ($view->get('display') as $display) { - $expected_options[$view->id() . ':' . $display['id']] = (string) t('View: @view - Display: @display', - ['@view' => $view->id(), '@display' => $display['id']]); + $expected_options[$view->id() . ':' . $display['id']] = "View: {$view->id()} - Display: {$display['id']}"; } } diff --git a/core/modules/views/tests/src/Kernel/Plugin/BlockDependenciesTest.php b/core/modules/views/tests/src/Kernel/Plugin/BlockDependenciesTest.php index a67b7bada52..f658f64e7e9 100644 --- a/core/modules/views/tests/src/Kernel/Plugin/BlockDependenciesTest.php +++ b/core/modules/views/tests/src/Kernel/Plugin/BlockDependenciesTest.php @@ -69,7 +69,7 @@ class BlockDependenciesTest extends ViewsKernelTestBase { * example: * @code * $this->createBlock('system_powered_by_block', array( - * 'label' => t('Hello, world!'), + * 'label' => 'Hello, world!', * )); * @endcode * The following defaults are provided: diff --git a/core/modules/views/tests/src/Kernel/Plugin/ExposedFormRenderTest.php b/core/modules/views/tests/src/Kernel/Plugin/ExposedFormRenderTest.php index 651cb829ec4..a581f8922cc 100644 --- a/core/modules/views/tests/src/Kernel/Plugin/ExposedFormRenderTest.php +++ b/core/modules/views/tests/src/Kernel/Plugin/ExposedFormRenderTest.php @@ -49,7 +49,7 @@ class ExposedFormRenderTest extends ViewsKernelTestBase { $expected_action = $view->display_handler->getUrlInfo()->toString(); $this->assertFieldByXPath('//form/@action', $expected_action, 'The expected value for the action attribute was found.'); // Make sure the description is shown. - $result = $this->xpath('//form//div[contains(@id, :id) and normalize-space(text())=:description]', [':id' => 'edit-type--2--description', ':description' => t('Exposed description')]); + $result = $this->xpath('//form//div[contains(@id, "edit-type--2--description") and normalize-space(text())="Exposed description"]'); $this->assertCount(1, $result, 'Filter description was found.'); } diff --git a/core/modules/views_ui/tests/src/Functional/HandlerTest.php b/core/modules/views_ui/tests/src/Functional/HandlerTest.php index 3815a9ec678..e20089a77c4 100644 --- a/core/modules/views_ui/tests/src/Functional/HandlerTest.php +++ b/core/modules/views_ui/tests/src/Functional/HandlerTest.php @@ -73,8 +73,8 @@ class HandlerTest extends UITestBase { protected function viewsData() { $data = parent::viewsData(); $data['views_test_data']['uid'] = [ - 'title' => t('UID'), - 'help' => t('The test data UID'), + 'title' => 'UID', + 'help' => 'The test data UID', 'relationship' => [ 'id' => 'standard', 'base' => 'users_field_data', @@ -84,7 +84,7 @@ class HandlerTest extends UITestBase { // Create a dummy field with no help text. $data['views_test_data']['no_help'] = $data['views_test_data']['name']; - $data['views_test_data']['no_help']['field']['title'] = t('No help'); + $data['views_test_data']['no_help']['field']['title'] = 'No help'; $data['views_test_data']['no_help']['field']['real field'] = 'name'; unset($data['views_test_data']['no_help']['help']); diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/MultiFormTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/MultiFormTest.php index 0896f8d2aad..fbd979c4e36 100644 --- a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/MultiFormTest.php +++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/MultiFormTest.php @@ -66,7 +66,6 @@ class MultiFormTest extends WebDriverTestBase { $form_xpath = '//form[starts-with(@id, "node-page-form")]'; $field_xpath = '//div[contains(@class, "field--name-field-ajax-test")]'; $button_name = $field_name . '_add_more'; - $button_value = t('Add another item'); $button_xpath_suffix = '//input[@name="' . $button_name . '"]'; $field_items_xpath_suffix = '//input[@type="text"]'; @@ -95,7 +94,7 @@ class MultiFormTest extends WebDriverTestBase { for ($i = 0; $i < 2; $i++) { $forms = $page->find('xpath', $form_xpath); foreach ($forms as $offset => $form) { - $button = $form->findButton($button_value); + $button = $form->findButton('Add another item'); $this->assertNotNull($button, 'Add Another Item button exists'); $button->press(); diff --git a/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php b/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php index 9ada56ef453..667bae83533 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php @@ -510,8 +510,8 @@ class ConfigEntityQueryTest extends KernelTestBase { */ public function testTableSort() { $header = [ - ['data' => t('ID'), 'specifier' => 'id'], - ['data' => t('Number'), 'specifier' => 'number'], + ['data' => 'ID', 'specifier' => 'id'], + ['data' => 'Number', 'specifier' => 'number'], ]; // Sort key: id diff --git a/core/tests/Drupal/KernelTests/Core/Messenger/MessengerTest.php b/core/tests/Drupal/KernelTests/Core/Messenger/MessengerTest.php index b81395c9d77..7507c903b11 100644 --- a/core/tests/Drupal/KernelTests/Core/Messenger/MessengerTest.php +++ b/core/tests/Drupal/KernelTests/Core/Messenger/MessengerTest.php @@ -37,7 +37,7 @@ class MessengerTest extends KernelTestBase { // Set two messages. $this->messenger->addStatus('First message (removed).'); - $this->messenger->addStatus(t('Second message with markup! (not removed).')); + $this->messenger->addStatus('Second message with markup! (not removed).'); $messages = $this->messenger->deleteByType(MessengerInterface::TYPE_STATUS); // Remove the first. unset($messages[0]); diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/ContextPluginTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/ContextPluginTest.php index 5a8dd1fb42a..e394a2d2da1 100644 --- a/core/tests/Drupal/KernelTests/Core/Plugin/ContextPluginTest.php +++ b/core/tests/Drupal/KernelTests/Core/Plugin/ContextPluginTest.php @@ -52,7 +52,7 @@ class ContextPluginTest extends KernelTestBase { } // Test the getContextDefinitions() method. - $user_context_definition = EntityContextDefinition::fromEntityTypeId('user')->setLabel(t('User')); + $user_context_definition = EntityContextDefinition::fromEntityTypeId('user')->setLabel('User'); $this->assertEquals($plugin->getContextDefinitions()['user']->getLabel(), $user_context_definition->getLabel()); // Test the getContextDefinition() method for a valid context.