From 4a7c205450bfbe91e2296b101b08c52400a0d12f Mon Sep 17 00:00:00 2001 From: catch <catch@35733.no-reply.drupal.org> Date: Fri, 28 Aug 2020 10:46:35 +0100 Subject: [PATCH] Issue #3153143 by ridhimaabrol24, Hardik_Patel_12, siddhant.bhosale, guptahemant, quietone, paulocs: Remove uses of t() in linkExists() and linkNotExists() calls --- .../book/tests/src/Functional/BookTest.php | 6 +++--- .../src/Functional/CommentLinksAlterTest.php | 2 +- .../tests/src/Functional/CommentLinksTest.php | 2 +- .../Functional/CommentNewIndicatorTest.php | 4 ++-- .../ConfigTranslationOverviewTest.php | 2 +- .../Functional/ConfigTranslationUiTest.php | 12 +++++------ .../src/Functional/EntityDisplayModeTest.php | 4 ++-- .../Functional/ManageFieldsFunctionalTest.php | 4 ++-- .../tests/src/Functional/ForumBlockTest.php | 4 ++-- .../tests/src/Functional/ForumIndexTest.php | 2 +- .../forum/tests/src/Functional/ForumTest.php | 8 ++++---- .../src/Functional/ForumUninstallTest.php | 2 +- .../MenuLinkContentDeleteFormTest.php | 2 +- .../MenuLinkContentTranslationUITest.php | 4 ++-- .../Functional/NodePreviewAnonymousTest.php | 2 +- .../NodeRevisionsUiBypassAccessTest.php | 8 ++++---- .../tests/src/Functional/NodeTypeTest.php | 2 +- .../tests/src/Functional/PagePreviewTest.php | 4 ++-- .../SearchConfigSettingsFormTest.php | 2 +- .../tests/src/Functional/TermTest.php | 2 +- .../tests/src/Functional/TrackerTest.php | 2 +- .../tests/src/Functional/UpdateUploadTest.php | 6 +++--- .../src/Functional/UserAccountLinksTest.php | 2 +- .../src/Functional/UserPasswordResetTest.php | 6 +++--- .../tests/src/Functional/AnalyzeTest.php | 2 +- .../tests/src/Functional/DefaultViewsTest.php | 4 ++-- .../tests/src/Functional/DisplayPathTest.php | 4 ++-- .../tests/src/Functional/DisplayTest.php | 2 +- .../tests/src/Functional/RowUITest.php | 2 +- .../tests/src/Functional/SettingsTest.php | 2 +- .../tests/src/Functional/StyleUITest.php | 2 +- .../tests/src/Functional/ViewEditTest.php | 20 +++++++++---------- .../tests/src/Functional/ViewsListTest.php | 2 +- .../tests/src/Functional/MinimalTest.php | 2 +- .../tests/src/Functional/StandardTest.php | 2 +- 35 files changed, 69 insertions(+), 69 deletions(-) diff --git a/core/modules/book/tests/src/Functional/BookTest.php b/core/modules/book/tests/src/Functional/BookTest.php index ac753591328e..99b4ae057917 100644 --- a/core/modules/book/tests/src/Functional/BookTest.php +++ b/core/modules/book/tests/src/Functional/BookTest.php @@ -247,7 +247,7 @@ public function testBookExport() { // Load the book and verify there is no printer-friendly version link. $this->drupalGet('node/' . $this->book->id()); - $this->assertSession()->linkNotExists(t('Printer-friendly version'), 'Anonymous user is not shown link to printer-friendly version.'); + $this->assertSession()->linkNotExists('Printer-friendly version', 'Anonymous user is not shown link to printer-friendly version.'); // Try getting the URL directly, and verify it fails. $this->drupalGet('book/export/html/' . $this->book->id()); @@ -427,14 +427,14 @@ public function testBookOutline() { // Create new node not yet a book. $empty_book = $this->drupalCreateNode(['type' => 'book']); $this->drupalGet('node/' . $empty_book->id() . '/outline'); - $this->assertSession()->linkNotExists(t('Book outline'), 'Book Author is not allowed to outline'); + $this->assertSession()->linkNotExists('Book outline', 'Book Author is not allowed to outline'); $this->drupalLogin($this->adminUser); $this->drupalGet('node/' . $empty_book->id() . '/outline'); $this->assertRaw(t('Book outline')); // Verify that the node does not belong to a book. $this->assertTrue($this->assertSession()->optionExists('edit-book-bid', 0)->isSelected()); - $this->assertSession()->linkNotExists(t('Remove from book outline')); + $this->assertSession()->linkNotExists('Remove from book outline'); $edit = []; $edit['book[bid]'] = '1'; diff --git a/core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php b/core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php index 9ad663132e9a..d7b16809b772 100644 --- a/core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php +++ b/core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php @@ -34,7 +34,7 @@ public function testCommentLinksAlter() { $this->drupalGet('node/' . $this->node->id()); - $this->assertSession()->linkExists(t('Report')); + $this->assertSession()->linkExists('Report'); } } diff --git a/core/modules/comment/tests/src/Functional/CommentLinksTest.php b/core/modules/comment/tests/src/Functional/CommentLinksTest.php index 92582f3d51d4..8f55c7259c59 100644 --- a/core/modules/comment/tests/src/Functional/CommentLinksTest.php +++ b/core/modules/comment/tests/src/Functional/CommentLinksTest.php @@ -101,7 +101,7 @@ public function testCommentLinks() { // In teaser view, a link containing the comment count is always // expected. if ($path == 'node') { - $this->assertSession()->linkExists(t('1 comment')); + $this->assertSession()->linkExists('1 comment'); } $this->assertSession()->linkExists('Add new comment'); } diff --git a/core/modules/comment/tests/src/Functional/CommentNewIndicatorTest.php b/core/modules/comment/tests/src/Functional/CommentNewIndicatorTest.php index b44dd5b08ecc..76ecbdd67d41 100644 --- a/core/modules/comment/tests/src/Functional/CommentNewIndicatorTest.php +++ b/core/modules/comment/tests/src/Functional/CommentNewIndicatorTest.php @@ -60,8 +60,8 @@ public function testCommentNewCommentsIndicator() { // node. $this->drupalLogin($this->adminUser); $this->drupalGet('node'); - $this->assertSession()->linkNotExists(t('@count comments', ['@count' => 0])); - $this->assertSession()->linkExists(t('Read more')); + $this->assertSession()->linkNotExists('0 comments'); + $this->assertSession()->linkExists('Read more'); // Verify the data-history-node-last-comment-timestamp attribute, which is // used by the drupal.node-new-comments-link library to determine whether // a "x new comments" link might be necessary or not. We do this in diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php index d97cba786df1..00d5bc3d2762 100644 --- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php +++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php @@ -126,7 +126,7 @@ public function testMapperListPage() { $this->assertRaw('<th>' . t('Language') . '</th>'); $this->drupalGet($base_url); - $this->assertSession()->linkExists(t('Translate @title', ['@title' => $entity_type->getSingularLabel()])); + $this->assertSession()->linkExists('Translate test configuration'); } } diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php index a65b1c60ecab..55960c851694 100644 --- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php +++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php @@ -299,7 +299,7 @@ public function testSourceValueDuplicateSave() { // While translator can access the translation page, the edit link is not // present due to lack of permissions. $this->drupalGet($translation_base_url); - $this->assertSession()->linkNotExists(t('Edit')); + $this->assertSession()->linkNotExists('Edit'); // Check 'Add' link for French. $this->assertLinkByHref("$translation_base_url/fr/add"); @@ -331,7 +331,7 @@ public function testContactConfigEntityTranslation() { // Make sure translate tab is present. $this->drupalGet('admin/structure/contact/manage/feedback'); - $this->assertSession()->linkExists(t('Translate @type', ['@type' => 'contact form'])); + $this->assertSession()->linkExists('Translate contact form'); // Visit the form to confirm the changes. $this->drupalGet('contact/feedback'); @@ -339,7 +339,7 @@ public function testContactConfigEntityTranslation() { foreach ($this->langcodes as $langcode) { $this->drupalGet($translation_base_url); - $this->assertSession()->linkExists(t('Translate @type', ['@type' => 'contact form'])); + $this->assertSession()->linkExists('Translate contact form'); // 'Add' link should be present for $langcode translation. $translation_page_url = "$translation_base_url/$langcode/add"; @@ -435,7 +435,7 @@ public function testContactConfigEntityTranslation() { // While translator can access the translation page, the edit link is not // present due to lack of permissions. $this->drupalGet($translation_base_url); - $this->assertSession()->linkNotExists(t('Edit')); + $this->assertSession()->linkNotExists('Edit'); // Check 'Add' link for French. $this->assertLinkByHref("$translation_base_url/fr/add"); @@ -516,10 +516,10 @@ public function testAccountSettingsConfigurationTranslation() { $this->drupalLogin($this->adminUser); $this->drupalGet('admin/config/people/accounts'); - $this->assertSession()->linkExists(t('Translate @type', ['@type' => 'account settings'])); + $this->assertSession()->linkExists('Translate account settings'); $this->drupalGet('admin/config/people/accounts/translate'); - $this->assertSession()->linkExists(t('Translate @type', ['@type' => 'account settings'])); + $this->assertSession()->linkExists('Translate account settings'); $this->assertLinkByHref('admin/config/people/accounts/translate/fr/add'); // Update account settings fields for French. diff --git a/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php b/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php index 99e2d5afb0b3..1c7be0857124 100644 --- a/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php +++ b/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php @@ -60,7 +60,7 @@ public function testEntityViewModeUI() { $this->assertSession()->statusCodeEquals(404); $this->drupalGet('admin/structure/display-modes/view/add'); - $this->assertSession()->linkNotExists(t('Test entity - revisions and data table'), 'An entity type with no view builder cannot have view modes.'); + $this->assertSession()->linkNotExists('Test entity - revisions and data table', 'An entity type with no view builder cannot have view modes.'); // Test adding a view mode including dots in machine_name. $this->clickLink(t('Test entity')); @@ -114,7 +114,7 @@ public function testEntityFormModeUI() { $this->assertSession()->statusCodeEquals(404); $this->drupalGet('admin/structure/display-modes/form/add'); - $this->assertSession()->linkNotExists(t('Entity Test without label'), 'An entity type with no form cannot have form modes.'); + $this->assertSession()->linkNotExists('Entity Test without label', 'An entity type with no form cannot have form modes.'); // Test adding a view mode including dots in machine_name. $this->clickLink(t('Test entity')); diff --git a/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php b/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php index 2a6b1e45bb2a..07a6222eb82e 100644 --- a/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php +++ b/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php @@ -291,9 +291,9 @@ public function cardinalitySettings() { $this->assertFieldByXPath("//input[@name='cardinality_number']", 6); // Check that tabs displayed. - $this->assertSession()->linkExists(t('Edit')); + $this->assertSession()->linkExists('Edit'); $this->assertLinkByHref('admin/structure/types/manage/article/fields/node.article.body'); - $this->assertSession()->linkExists(t('Field settings')); + $this->assertSession()->linkExists('Field settings'); $this->assertLinkByHref($field_edit_path); // Add two entries in the body. diff --git a/core/modules/forum/tests/src/Functional/ForumBlockTest.php b/core/modules/forum/tests/src/Functional/ForumBlockTest.php index 10d680ff524b..ce124c9efa8f 100644 --- a/core/modules/forum/tests/src/Functional/ForumBlockTest.php +++ b/core/modules/forum/tests/src/Functional/ForumBlockTest.php @@ -58,7 +58,7 @@ public function testNewForumTopicsBlock() { // Create 5 forum topics. $topics = $this->createForumTopics(); - $this->assertSession()->linkExists(t('More'), 0, 'New forum topics block has a "more"-link.'); + $this->assertSession()->linkExists('More', 0, 'New forum topics block has a "more"-link.'); $this->assertLinkByHref('forum', 0, 'New forum topics block has a "more"-link.'); // We expect all 5 forum topics to appear in the "New forum topics" block. @@ -113,7 +113,7 @@ public function testActiveForumTopicsBlock() { // Enable the block. $block = $this->drupalPlaceBlock('forum_active_block'); $this->drupalGet(''); - $this->assertSession()->linkExists(t('More'), 0, 'Active forum topics block has a "more"-link.'); + $this->assertSession()->linkExists('More', 0, 'Active forum topics block has a "more"-link.'); $this->assertLinkByHref('forum', 0, 'Active forum topics block has a "more"-link.'); // We expect the first 5 forum topics to appear in the "Active forum topics" diff --git a/core/modules/forum/tests/src/Functional/ForumIndexTest.php b/core/modules/forum/tests/src/Functional/ForumIndexTest.php index 76f1cdd6fd9b..33fb224dc658 100644 --- a/core/modules/forum/tests/src/Functional/ForumIndexTest.php +++ b/core/modules/forum/tests/src/Functional/ForumIndexTest.php @@ -68,7 +68,7 @@ public function testForumIndexStatus() { 'parent[0]' => $tid, ]; $this->drupalPostForm('admin/structure/forum/add/forum', $edit, t('Save')); - $this->assertSession()->linkExists(t('edit forum')); + $this->assertSession()->linkExists('edit forum'); $tid_child = $tid + 1; diff --git a/core/modules/forum/tests/src/Functional/ForumTest.php b/core/modules/forum/tests/src/Functional/ForumTest.php index fb2587dc76e9..dd82a0cdca5b 100644 --- a/core/modules/forum/tests/src/Functional/ForumTest.php +++ b/core/modules/forum/tests/src/Functional/ForumTest.php @@ -189,9 +189,9 @@ public function testForum() { // Verify that this user is shown a local task to add new forum content. $this->drupalGet('forum'); - $this->assertSession()->linkExists(t('Add new Forum topic')); + $this->assertSession()->linkExists('Add new Forum topic'); $this->drupalGet('forum/' . $this->forum['tid']); - $this->assertSession()->linkExists(t('Add new Forum topic')); + $this->assertSession()->linkExists('Add new Forum topic'); // Log in a user with permission to edit any forum content. $this->drupalLogin($this->editAnyTopicsUser); @@ -260,7 +260,7 @@ public function testForum() { // Test anonymous action link. $this->drupalLogout(); $this->drupalGet('forum/' . $this->forum['tid']); - $this->assertSession()->linkExists(t('Log in to post new content in the forum.')); + $this->assertSession()->linkExists('Log in to post new content in the forum.'); } /** @@ -369,7 +369,7 @@ private function doAdminTests($user) { // Test tags vocabulary form is not affected. $this->drupalGet('admin/structure/taxonomy/manage/tags'); $this->assertSession()->buttonExists('Save'); - $this->assertSession()->linkExists(t('Delete')); + $this->assertSession()->linkExists('Delete'); // Test tags vocabulary term form is not affected. $this->drupalGet('admin/structure/taxonomy/manage/tags/add'); $this->assertSession()->fieldExists('parent[]'); diff --git a/core/modules/forum/tests/src/Functional/ForumUninstallTest.php b/core/modules/forum/tests/src/Functional/ForumUninstallTest.php index e07114cc559a..ec8682bc3c53 100644 --- a/core/modules/forum/tests/src/Functional/ForumUninstallTest.php +++ b/core/modules/forum/tests/src/Functional/ForumUninstallTest.php @@ -97,7 +97,7 @@ public function testForumUninstallWithField() { // Ensure that the forum node type can not be deleted. $this->drupalGet('admin/structure/types/manage/forum'); - $this->assertSession()->linkNotExists(t('Delete')); + $this->assertSession()->linkNotExists('Delete'); // Now attempt to uninstall forum. $this->drupalGet('admin/modules/uninstall'); 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 6565534a9bce..7aabe80ae553 100644 --- a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentDeleteFormTest.php +++ b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentDeleteFormTest.php @@ -52,7 +52,7 @@ public function testMenuLinkContentDeleteForm() { $menu_link = MenuLinkContent::load(1); $this->drupalGet($menu_link->toUrl('delete-form')); $this->assertRaw(t('Are you sure you want to delete the custom menu link %name?', ['%name' => $menu_link->label()])); - $this->assertSession()->linkExists(t('Cancel')); + $this->assertSession()->linkExists('Cancel'); // Make sure cancel link points to link edit $this->assertLinkByHref($menu_link->toUrl('edit-form')->toString()); diff --git a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php index 649c45b640a0..231deba23958 100644 --- a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php +++ b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php @@ -73,7 +73,7 @@ protected function createEntity($values, $langcode, $bundle_name = NULL) { */ public function testTranslationLinkOnMenuEditForm() { $this->drupalGet('admin/structure/menu/manage/tools'); - $this->assertSession()->linkNotExists(t('Translate')); + $this->assertSession()->linkNotExists('Translate'); $menu_link_content = MenuLinkContent::create([ 'menu_name' => 'tools', @@ -82,7 +82,7 @@ public function testTranslationLinkOnMenuEditForm() { ]); $menu_link_content->save(); $this->drupalGet('admin/structure/menu/manage/tools'); - $this->assertSession()->linkExists(t('Translate')); + $this->assertSession()->linkExists('Translate'); } /** diff --git a/core/modules/node/tests/src/Functional/NodePreviewAnonymousTest.php b/core/modules/node/tests/src/Functional/NodePreviewAnonymousTest.php index 64a7c1ab5305..303825e16dba 100644 --- a/core/modules/node/tests/src/Functional/NodePreviewAnonymousTest.php +++ b/core/modules/node/tests/src/Functional/NodePreviewAnonymousTest.php @@ -59,7 +59,7 @@ public function testAnonymousPagePreview() { $this->drupalPostForm('node/add/page', $edit, t('Preview')); // Check that the preview is displaying the title, body and term. - $this->assertSession()->linkExists(t('Back to content editing')); + $this->assertSession()->linkExists('Back to content editing'); $this->assertSession()->responseContains($edit[$body_key]); $this->assertSession()->titleEquals($edit[$title_key] . ' | Drupal'); } diff --git a/core/modules/node/tests/src/Functional/NodeRevisionsUiBypassAccessTest.php b/core/modules/node/tests/src/Functional/NodeRevisionsUiBypassAccessTest.php index 51b277860b4d..67ab07985b1d 100644 --- a/core/modules/node/tests/src/Functional/NodeRevisionsUiBypassAccessTest.php +++ b/core/modules/node/tests/src/Functional/NodeRevisionsUiBypassAccessTest.php @@ -75,7 +75,7 @@ public function testDisplayRevisionTab() { $this->assertUrl($node->toUrl()); // Verify revisions exist since the content type has revisions enabled. - $this->assertSession()->linkExists(t('Revisions')); + $this->assertSession()->linkExists('Revisions'); // Verify the checkbox is checked on the node edit form. $this->drupalGet('node/' . $node->id() . '/edit'); @@ -86,7 +86,7 @@ public function testDisplayRevisionTab() { $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save'); $this->assertUrl($node->toUrl()); - $this->assertSession()->linkExists(t('Revisions')); + $this->assertSession()->linkExists('Revisions'); // Unset page revision setting 'create new revision'. This will mean new // revisions are not created by default when the node is edited. @@ -107,7 +107,7 @@ public function testDisplayRevisionTab() { $this->assertUrl($node->toUrl()); // Verify that no link to revisions is displayed since the type // has the 'create new revision' setting unset. - $this->assertSession()->linkNotExists(t('Revisions')); + $this->assertSession()->linkNotExists('Revisions'); // Verify the checkbox is unchecked on the node edit form. $this->drupalGet('node/' . $node->id() . '/edit'); @@ -120,7 +120,7 @@ public function testDisplayRevisionTab() { $this->assertUrl($node->toUrl()); // Verify that the link is displayed since a new revision is created and // the 'create new revision' checkbox on the node is checked. - $this->assertSession()->linkExists(t('Revisions')); + $this->assertSession()->linkExists('Revisions'); } } diff --git a/core/modules/node/tests/src/Functional/NodeTypeTest.php b/core/modules/node/tests/src/Functional/NodeTypeTest.php index 312756e95725..e128f4eced25 100644 --- a/core/modules/node/tests/src/Functional/NodeTypeTest.php +++ b/core/modules/node/tests/src/Functional/NodeTypeTest.php @@ -211,7 +211,7 @@ public function testNodeTypeDeletion() { // way installing a module through the UI does. $this->resetAll(); $this->drupalGet('admin/structure/types/manage/default'); - $this->assertSession()->linkNotExists(t('Delete')); + $this->assertSession()->linkNotExists('Delete'); $this->drupalGet('admin/structure/types/manage/default/delete'); $this->assertSession()->statusCodeEquals(403); $this->container->get('module_installer')->uninstall(['node_test_config']); diff --git a/core/modules/node/tests/src/Functional/PagePreviewTest.php b/core/modules/node/tests/src/Functional/PagePreviewTest.php index cf8feb6f976e..68c64fc6f0c0 100644 --- a/core/modules/node/tests/src/Functional/PagePreviewTest.php +++ b/core/modules/node/tests/src/Functional/PagePreviewTest.php @@ -207,7 +207,7 @@ public function testPagePreview() { $this->assertSession()->assertEscaped($edit[$title_key]); $this->assertText($edit[$body_key], 'Body displayed.'); $this->assertText($edit[$term_key], 'Term displayed.'); - $this->assertSession()->linkExists(t('Back to content editing')); + $this->assertSession()->linkExists('Back to content editing'); // Check that we see the class of the node type on the body element. $body_class_element = $this->xpath("//body[contains(@class, 'page-node-type-page')]"); @@ -247,7 +247,7 @@ public function testPagePreview() { $this->assertSession()->assertEscaped($edit[$title_key]); $this->assertText($edit[$body_key], 'Body displayed.'); $this->assertText($edit[$term_key], 'Term displayed.'); - $this->assertSession()->linkExists(t('Back to content editing')); + $this->assertSession()->linkExists('Back to content editing'); // Assert the content is kept when reloading the page. $this->drupalGet('node/add/page', ['query' => ['uuid' => $uuid]]); diff --git a/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php b/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php index 23a10fadce87..d56d2711330a 100644 --- a/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php +++ b/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php @@ -323,7 +323,7 @@ public function testMultipleSearchPages() { // Disable the first search page. $this->clickLink(t('Disable')); $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->linkNotExists(t('Disable')); + $this->assertSession()->linkNotExists('Disable'); $this->verifySearchPageOperations($first_id, TRUE, TRUE, FALSE, TRUE); $this->verifySearchPageOperations($second_id, TRUE, FALSE, FALSE, FALSE); diff --git a/core/modules/taxonomy/tests/src/Functional/TermTest.php b/core/modules/taxonomy/tests/src/Functional/TermTest.php index 4ddb81619295..27c0fcf647b4 100644 --- a/core/modules/taxonomy/tests/src/Functional/TermTest.php +++ b/core/modules/taxonomy/tests/src/Functional/TermTest.php @@ -358,7 +358,7 @@ public function testTermInterface() { // Check that the term is still present at admin UI after edit. $this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/overview'); $this->assertText($edit['name[0][value]'], 'The randomly generated term name is present.'); - $this->assertSession()->linkExists(t('Edit')); + $this->assertSession()->linkExists('Edit'); // Check the term link can be clicked through to the term page. $this->clickLink($edit['name[0][value]']); diff --git a/core/modules/tracker/tests/src/Functional/TrackerTest.php b/core/modules/tracker/tests/src/Functional/TrackerTest.php index a503263e7ec2..6494bc850f15 100644 --- a/core/modules/tracker/tests/src/Functional/TrackerTest.php +++ b/core/modules/tracker/tests/src/Functional/TrackerTest.php @@ -91,7 +91,7 @@ public function testTrackerAll() { $this->drupalGet('activity'); $this->assertNoText($unpublished->label(), 'Unpublished node does not show up in the tracker listing.'); $this->assertText($published->label(), 'Published node shows up in the tracker listing.'); - $this->assertSession()->linkExists(t('My recent content'), 0, 'User tab shows up on the global tracker page.'); + $this->assertSession()->linkExists('My recent content', 0, 'User tab shows up on the global tracker page.'); // Assert cache contexts, specifically the pager and node access contexts. $this->assertCacheContexts(['languages:language_interface', 'route', 'theme', 'url.query_args:' . MainContentViewSubscriber::WRAPPER_FORMAT, 'url.query_args.pagers:0', 'user.node_grants:view', 'user']); diff --git a/core/modules/update/tests/src/Functional/UpdateUploadTest.php b/core/modules/update/tests/src/Functional/UpdateUploadTest.php index b01b82ef7160..88ab8fc72327 100644 --- a/core/modules/update/tests/src/Functional/UpdateUploadTest.php +++ b/core/modules/update/tests/src/Functional/UpdateUploadTest.php @@ -92,11 +92,11 @@ public function testUploadModule() { $this->assertFileExists($installedInfoFilePath); // Ensure the links are relative to the site root and not // core/authorize.php. - $this->assertSession()->linkExists(t('Install another module')); + $this->assertSession()->linkExists('Install another module'); $this->assertLinkByHref(Url::fromRoute('update.module_install')->toString()); - $this->assertSession()->linkExists(t('Enable newly added modules')); + $this->assertSession()->linkExists('Enable newly added modules'); $this->assertLinkByHref(Url::fromRoute('system.modules_list')->toString()); - $this->assertSession()->linkExists(t('Administration pages')); + $this->assertSession()->linkExists('Administration pages'); $this->assertLinkByHref(Url::fromRoute('system.admin')->toString()); // Ensure we can reach the "Install another module" link. $this->clickLink(t('Install another module')); diff --git a/core/modules/user/tests/src/Functional/UserAccountLinksTest.php b/core/modules/user/tests/src/Functional/UserAccountLinksTest.php index a1486b15b02f..e68d64e0b2d9 100644 --- a/core/modules/user/tests/src/Functional/UserAccountLinksTest.php +++ b/core/modules/user/tests/src/Functional/UserAccountLinksTest.php @@ -137,7 +137,7 @@ public function testAccountPageTitles() { // Check the page title for registered users is "My Account" in menus. $this->drupalLogin($this->drupalCreateUser()); // After login, the client is redirected to /user. - $this->assertSession()->linkExists(t('My account'), 0, "Page title of /user is 'My Account' in menus for registered users"); + $this->assertSession()->linkExists('My account', 0, "Page title of /user is 'My Account' in menus for registered users"); $this->assertLinkByHref(\Drupal::urlGenerator()->generate('user.page'), 0); } diff --git a/core/modules/user/tests/src/Functional/UserPasswordResetTest.php b/core/modules/user/tests/src/Functional/UserPasswordResetTest.php index 236d0317aa16..7c8e3af55111 100644 --- a/core/modules/user/tests/src/Functional/UserPasswordResetTest.php +++ b/core/modules/user/tests/src/Functional/UserPasswordResetTest.php @@ -109,7 +109,7 @@ public function testUserPasswordReset() { // Check successful login. $this->drupalPostForm(NULL, NULL, t('Log in')); - $this->assertSession()->linkExists(t('Log out')); + $this->assertSession()->linkExists('Log out'); $this->assertSession()->titleEquals($this->account->getAccountName() . ' | Drupal'); // Change the forgotten password. @@ -188,7 +188,7 @@ public function testUserPasswordReset() { $this->drupalPostForm(NULL, $edit, t('Submit')); $reset_url = $this->getResetURL(); $this->drupalGet($reset_url . '/login'); - $this->assertSession()->linkExists(t('Log out')); + $this->assertSession()->linkExists('Log out'); $this->assertSession()->titleEquals($this->account->getAccountName() . ' | Drupal'); // Ensure blocked and deleted accounts can't access the user.reset.login @@ -358,7 +358,7 @@ public function testUserResetPasswordUserFloodControlIsCleared() { // Use the last password reset URL which was generated. $reset_url = $this->getResetURL(); $this->drupalGet($reset_url . '/login'); - $this->assertSession()->linkExists(t('Log out')); + $this->assertSession()->linkExists('Log out'); $this->assertSession()->titleEquals($this->account->getAccountName() . ' | Drupal'); $this->drupalLogout(); diff --git a/core/modules/views_ui/tests/src/Functional/AnalyzeTest.php b/core/modules/views_ui/tests/src/Functional/AnalyzeTest.php index f3acc23733d7..143ebd097312 100644 --- a/core/modules/views_ui/tests/src/Functional/AnalyzeTest.php +++ b/core/modules/views_ui/tests/src/Functional/AnalyzeTest.php @@ -35,7 +35,7 @@ public function testAnalyzeBasic() { $this->drupalLogin($this->adminUser); $this->drupalGet('admin/structure/views/view/test_view/edit'); - $this->assertSession()->linkExists(t('Analyze view')); + $this->assertSession()->linkExists('Analyze view'); // This redirects the user to the analyze form. $this->clickLink(t('Analyze view')); diff --git a/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php b/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php index dd9ca344a7a2..cb3cb291c9ef 100644 --- a/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php +++ b/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php @@ -53,7 +53,7 @@ public function testDefaultViews() { // It should not be possible to revert the view yet. // @todo Figure out how to handle this with the new configuration system. - // $this->assertSession()->linkNotExists(t('Revert')); + // $this->assertSession()->linkNotExists('Revert'); // $revert_href = 'admin/structure/views/view/glossary/revert'; // $this->assertNoLinkByHref($revert_href); @@ -81,7 +81,7 @@ public function testDefaultViews() { // It should now be possible to revert the view. Do that, and make sure the // view title we added above no longer is displayed. // $this->drupalGet('admin/structure/views'); - // $this->assertSession()->linkExists(t('Revert')); + // $this->assertSession()->linkExists('Revert'); // $this->assertLinkByHref($revert_href); // $this->drupalPostForm($revert_href, array(), t('Revert')); // $this->drupalGet('glossary'); diff --git a/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php b/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php index 99c8a4be8c61..e3e43f3518d8 100644 --- a/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php +++ b/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php @@ -57,7 +57,7 @@ protected function doBasicPathUITest() { // Add a new page display and check the appearing text. $this->drupalPostForm(NULL, [], 'Add Page'); $this->assertText(t('No path is set'), 'The right text appears if no path was set.'); - $this->assertSession()->linkNotExists(t('View @display', ['@display' => 'page']), 'No view page link found on the page.'); + $this->assertSession()->linkNotExists('View page', 'No view page link found on the page.'); // Save a path and make sure the summary appears as expected. $random_path = $this->randomMachineName(); @@ -159,7 +159,7 @@ public function testMenuOptions() { $this->assertUrl('admin/structure/views/view/test_view/edit/page_1'); $this->drupalGet('admin/structure/views/view/test_view'); - $this->assertSession()->linkExists(t('Tab: @title', ['@title' => 'Test tab title'])); + $this->assertSession()->linkExists('Tab: Test tab title'); // If it's a default tab, it should also have an additional settings link. $this->assertLinkByHref('admin/structure/views/nojs/display/test_view/page_1/tab_options'); diff --git a/core/modules/views_ui/tests/src/Functional/DisplayTest.php b/core/modules/views_ui/tests/src/Functional/DisplayTest.php index 1a75df3c46e1..d13ce2d2b311 100644 --- a/core/modules/views_ui/tests/src/Functional/DisplayTest.php +++ b/core/modules/views_ui/tests/src/Functional/DisplayTest.php @@ -173,7 +173,7 @@ public function testLinkDisplay() { // The form redirects to the master display. $this->drupalGet($path); - $this->assertSession()->linkExists(t('Custom URL'), 0, 'The link option has custom URL as summary.'); + $this->assertSession()->linkExists('Custom URL', 0, 'The link option has custom URL as summary.'); // Test the default link_url value for new display $this->drupalPostForm(NULL, [], t('Add Block')); diff --git a/core/modules/views_ui/tests/src/Functional/RowUITest.php b/core/modules/views_ui/tests/src/Functional/RowUITest.php index 79e9087731e2..a29697b2e861 100644 --- a/core/modules/views_ui/tests/src/Functional/RowUITest.php +++ b/core/modules/views_ui/tests/src/Functional/RowUITest.php @@ -52,7 +52,7 @@ public function testRowUI() { $this->assertFieldByName('row_options[test_option]', $random_name, 'Make sure the custom settings form field has the expected value stored.'); $this->drupalPostForm($view_edit_url, [], t('Save')); - $this->assertSession()->linkExists(t('Test row plugin'), 0, 'Make sure the test row plugin is shown in the UI'); + $this->assertSession()->linkExists('Test row plugin', 0, 'Make sure the test row plugin is shown in the UI'); $view = Views::getView($view_name); $view->initDisplay(); diff --git a/core/modules/views_ui/tests/src/Functional/SettingsTest.php b/core/modules/views_ui/tests/src/Functional/SettingsTest.php index be6e218f03b6..f14bb90e01f1 100644 --- a/core/modules/views_ui/tests/src/Functional/SettingsTest.php +++ b/core/modules/views_ui/tests/src/Functional/SettingsTest.php @@ -76,7 +76,7 @@ public function testEditUI() { $view['id'] = strtolower($this->randomMachineName()); $this->drupalPostForm('admin/structure/views/add', $view, t('Save and edit')); - $this->assertSession()->linkNotExists(t('Master')); + $this->assertSession()->linkNotExists('Master'); // Configure to always show the advanced settings. // @todo It doesn't seem to be a way to test this as this works just on js. diff --git a/core/modules/views_ui/tests/src/Functional/StyleUITest.php b/core/modules/views_ui/tests/src/Functional/StyleUITest.php index b85c65c56a35..4d5f0588a3a6 100644 --- a/core/modules/views_ui/tests/src/Functional/StyleUITest.php +++ b/core/modules/views_ui/tests/src/Functional/StyleUITest.php @@ -51,7 +51,7 @@ public function testStyleUI() { $this->assertFieldByName('style_options[test_option]', $random_name, 'Make sure the custom settings form field has the expected value stored.'); $this->drupalPostForm($view_edit_url, [], t('Save')); - $this->assertSession()->linkExists(t('Test style plugin'), 0, 'Make sure the test style plugin is shown in the UI'); + $this->assertSession()->linkExists('Test style plugin', 0, 'Make sure the test style plugin is shown in the UI'); $view = Views::getView($view_name); $view->initDisplay(); diff --git a/core/modules/views_ui/tests/src/Functional/ViewEditTest.php b/core/modules/views_ui/tests/src/Functional/ViewEditTest.php index 69a3dbe3f475..b7d7b4c5ef7d 100644 --- a/core/modules/views_ui/tests/src/Functional/ViewEditTest.php +++ b/core/modules/views_ui/tests/src/Functional/ViewEditTest.php @@ -29,7 +29,7 @@ class ViewEditTest extends UITestBase { */ public function testDeleteLink() { $this->drupalGet('admin/structure/views/view/test_view'); - $this->assertSession()->linkExists(t('Delete view'), 0, 'Ensure that the view delete link appears'); + $this->assertSession()->linkExists('Delete view', 0, 'Ensure that the view delete link appears'); $view = $this->container->get('entity_type.manager')->getStorage('view')->load('test_view'); $this->assertInstanceOf(View::class, $view); @@ -59,7 +59,7 @@ public function testOtherOptions() { // Change the machine name for the display from page_1 to test_1. $edit = ['display_id' => 'test_1']; $this->drupalPostForm('admin/structure/views/nojs/display/test_view/attachment_1/display_id', $edit, 'Apply'); - $this->assertSession()->linkExists(t('test_1')); + $this->assertSession()->linkExists('test_1'); // Save the view, and test the new ID has been saved. $this->drupalPostForm(NULL, [], 'Save'); @@ -73,7 +73,7 @@ public function testOtherOptions() { $edit = ['display_id' => 'test_1']; $this->drupalPostForm('admin/structure/views/nojs/display/test_view/test_1/display_id', $edit, 'Apply'); $this->drupalPostForm(NULL, [], 'Save'); - $this->assertSession()->linkExists(t('test_1')); + $this->assertSession()->linkExists('test_1'); // Test the form validation with invalid IDs. $machine_name_edit_url = 'admin/structure/views/nojs/display/test_view/test_1/display_id'; @@ -103,7 +103,7 @@ public function testOtherOptions() { // Test that the display ID has not been changed. $this->drupalGet('admin/structure/views/view/test_view/edit/test_1'); - $this->assertSession()->linkExists(t('test_1')); + $this->assertSession()->linkExists('test_1'); // Test that validation does not run on cancel. $this->drupalGet('admin/structure/views/view/test_view'); @@ -136,8 +136,8 @@ public function testEditFormLanguageOptions() { $this->assertSession()->statusCodeEquals(200); $langcode_url = 'admin/structure/views/nojs/display/' . $view_name . '/' . $display . '/rendering_language'; $this->assertNoLinkByHref($langcode_url); - $assert_session->linkNotExistsExact(t('@type language selected for page', ['@type' => t('Content')])); - $this->assertSession()->linkNotExists(t('Content language of view row')); + $assert_session->linkNotExistsExact('Content language selected for page'); + $this->assertSession()->linkNotExists('Content language of view row'); } // Make the site multilingual and test the options again. @@ -153,13 +153,13 @@ public function testEditFormLanguageOptions() { $langcode_url = 'admin/structure/views/nojs/display/' . $view_name . '/' . $display . '/rendering_language'; if ($view_name == 'test_view') { $this->assertNoLinkByHref($langcode_url); - $assert_session->linkNotExistsExact(t('@type language selected for page', ['@type' => t('Content')])); - $this->assertSession()->linkNotExists(t('Content language of view row')); + $assert_session->linkNotExistsExact('Content language selected for page'); + $this->assertSession()->linkNotExists('Content language of view row'); } else { $this->assertLinkByHref($langcode_url); - $assert_session->linkNotExistsExact(t('@type language selected for page', ['@type' => t('Content')])); - $this->assertSession()->linkExists(t('Content language of view row')); + $assert_session->linkNotExistsExact('Content language selected for page'); + $this->assertSession()->linkExists('Content language of view row'); } $this->drupalGet($langcode_url); diff --git a/core/modules/views_ui/tests/src/Functional/ViewsListTest.php b/core/modules/views_ui/tests/src/Functional/ViewsListTest.php index fa9286384968..2753674dce90 100644 --- a/core/modules/views_ui/tests/src/Functional/ViewsListTest.php +++ b/core/modules/views_ui/tests/src/Functional/ViewsListTest.php @@ -50,7 +50,7 @@ public function testViewsListLimit() { // Check if we can access the main views admin page. $this->drupalGet('admin/structure/views'); $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->linkExists(t('Add view')); + $this->assertSession()->linkExists('Add view'); // Check that there is a link to the content view without a destination // parameter. diff --git a/core/profiles/minimal/tests/src/Functional/MinimalTest.php b/core/profiles/minimal/tests/src/Functional/MinimalTest.php index 6b3baa14df4b..72e164a45a50 100644 --- a/core/profiles/minimal/tests/src/Functional/MinimalTest.php +++ b/core/profiles/minimal/tests/src/Functional/MinimalTest.php @@ -28,7 +28,7 @@ class MinimalTest extends BrowserTestBase { public function testMinimal() { $this->drupalGet(''); // Check the login block is present. - $this->assertSession()->linkExists(t('Create new account')); + $this->assertSession()->linkExists('Create new account'); $this->assertSession()->statusCodeEquals(200); // Create a user to test tools and navigation blocks for logged in users diff --git a/core/profiles/standard/tests/src/Functional/StandardTest.php b/core/profiles/standard/tests/src/Functional/StandardTest.php index 8e3805d1c996..5a93f8e19755 100644 --- a/core/profiles/standard/tests/src/Functional/StandardTest.php +++ b/core/profiles/standard/tests/src/Functional/StandardTest.php @@ -38,7 +38,7 @@ class StandardTest extends BrowserTestBase { */ public function testStandard() { $this->drupalGet(''); - $this->assertSession()->linkExists(t('Contact')); + $this->assertSession()->linkExists('Contact'); $this->clickLink(t('Contact')); $this->assertSession()->statusCodeEquals(200); -- GitLab