diff --git a/core/modules/action/tests/src/Functional/ConfigurationTest.php b/core/modules/action/tests/src/Functional/ConfigurationTest.php index 967388577fd8..98b79c55eb7c 100644 --- a/core/modules/action/tests/src/Functional/ConfigurationTest.php +++ b/core/modules/action/tests/src/Functional/ConfigurationTest.php @@ -59,7 +59,7 @@ class ConfigurationTest extends BrowserTestBase { $this->assertSession()->pageTextContains($action_label); // Make another POST request to the action edit page. - $this->clickLink(t('Configure')); + $this->clickLink('Configure'); $edit = []; $new_action_label = $this->randomMachineName(); @@ -77,12 +77,12 @@ class ConfigurationTest extends BrowserTestBase { $this->assertSession()->pageTextContains($new_action_label); // Make sure the URL appears when re-editing the action. - $this->clickLink(t('Configure')); + $this->clickLink('Configure'); $this->assertSession()->fieldValueEquals('url', 'admin'); // Make sure that deletions work properly. $this->drupalGet('admin/config/system/actions'); - $this->clickLink(t('Delete')); + $this->clickLink('Delete'); $this->assertSession()->statusCodeEquals(200); $edit = []; $this->submitForm($edit, 'Delete'); diff --git a/core/modules/aggregator/tests/src/Functional/FeedParserTest.php b/core/modules/aggregator/tests/src/Functional/FeedParserTest.php index bed280f583d9..bdbfe0833b96 100644 --- a/core/modules/aggregator/tests/src/Functional/FeedParserTest.php +++ b/core/modules/aggregator/tests/src/Functional/FeedParserTest.php @@ -118,7 +118,7 @@ class FeedParserTest extends AggregatorTestBase { // Update the feed. Use the UI to be able to check the message easily. $this->drupalGet('admin/config/services/aggregator'); - $this->clickLink(t('Update items')); + $this->clickLink('Update items'); $this->assertRaw(t('The feed from %title seems to be broken because of error', ['%title' => $feed->label()])); } diff --git a/core/modules/block/tests/src/Functional/BlockTest.php b/core/modules/block/tests/src/Functional/BlockTest.php index 8dbe97c7a5bd..e7595cf8d24a 100644 --- a/core/modules/block/tests/src/Functional/BlockTest.php +++ b/core/modules/block/tests/src/Functional/BlockTest.php @@ -243,7 +243,7 @@ class BlockTest extends BlockTestBase { // Test deleting the block from the edit form. $this->drupalGet('admin/structure/block/manage/' . $block['id']); - $this->clickLink(t('Remove block')); + $this->clickLink('Remove block'); $this->assertRaw(t('Are you sure you want to remove the block @name?', ['@name' => $block['settings[label]']])); $this->submitForm([], 'Remove'); $this->assertRaw(t('The block %name has been removed.', ['%name' => $block['settings[label]']])); @@ -251,7 +251,7 @@ class BlockTest extends BlockTestBase { // Test deleting a block via "Configure block" link. $block = $this->drupalPlaceBlock('system_powered_by_block'); $this->drupalGet('admin/structure/block/manage/' . $block->id(), ['query' => ['destination' => 'admin']]); - $this->clickLink(t('Remove block')); + $this->clickLink('Remove block'); $this->assertRaw(t('Are you sure you want to remove the block @name?', ['@name' => $block->label()])); $this->submitForm([], 'Remove'); $this->assertRaw(t('The block %name has been removed.', ['%name' => $block->label()])); diff --git a/core/modules/block/tests/src/Functional/BlockUiTest.php b/core/modules/block/tests/src/Functional/BlockUiTest.php index f496255b405a..c55d62fd41ef 100644 --- a/core/modules/block/tests/src/Functional/BlockUiTest.php +++ b/core/modules/block/tests/src/Functional/BlockUiTest.php @@ -92,7 +92,7 @@ class BlockUiTest extends BrowserTestBase { public function testBlockDemoUiPage() { $this->drupalPlaceBlock('help_block', ['region' => 'help']); $this->drupalGet('admin/structure/block'); - $this->clickLink(t('Demonstrate block regions (@theme)', ['@theme' => 'Classy'])); + $this->clickLink('Demonstrate block regions (Classy)'); $this->assertSession()->elementExists('xpath', '//div[contains(@class, "region-highlighted")]/div[contains(@class, "block-region") and contains(text(), "Highlighted")]'); // Ensure that other themes can use the block demo page. diff --git a/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php b/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php index 1e2b625d1a14..92b2dc75b9cb 100644 --- a/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php +++ b/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php @@ -105,7 +105,7 @@ class DisplayBlockTest extends ViewTestBase { $this->drupalGet('admin/structure/views/view/' . $edit['id'] . '/edit/block_1'); $link = $this->xpath('//a[@id="views-block-1-block-category" and normalize-space(text())=:category]', $arguments); $this->assertTrue(!empty($link)); - $this->clickLink(t('Lists (Views)')); + $this->clickLink('Lists (Views)'); $category = $this->randomString(); $this->submitForm(['block_category' => $category], 'Apply'); diff --git a/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php b/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php index 593d0cbf1871..31be78f8c4ac 100644 --- a/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php +++ b/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php @@ -122,7 +122,7 @@ class BlockContentCreationTest extends BlockContentTestBase { // Set test_view_mode as a custom display to be available on the list. $this->drupalGet('admin/structure/block/block-content'); $this->drupalGet('admin/structure/block/block-content/types'); - $this->clickLink(t('Manage display')); + $this->clickLink('Manage display'); $this->drupalGet('admin/structure/block/block-content/manage/basic/display'); $custom_view_mode = [ 'display_modes_custom[test_view_mode]' => 1, diff --git a/core/modules/block_content/tests/src/Functional/BlockContentListTest.php b/core/modules/block_content/tests/src/Functional/BlockContentListTest.php index 4f1f469b729d..69ea45ca7f30 100644 --- a/core/modules/block_content/tests/src/Functional/BlockContentListTest.php +++ b/core/modules/block_content/tests/src/Functional/BlockContentListTest.php @@ -53,9 +53,7 @@ class BlockContentListTest extends BlockContentTestBase { $label = 'Antelope'; $new_label = 'Albatross'; // Add a new entity using the operations link. - $link_text = t('Add custom block'); - $this->assertSession()->linkExists($link_text); - $this->clickLink($link_text); + $this->clickLink('Add custom block'); $this->assertSession()->statusCodeEquals(200); $edit = []; $edit['info[0][value]'] = $label; @@ -81,7 +79,7 @@ class BlockContentListTest extends BlockContentTestBase { $block = reset($blocks); if (!empty($block)) { $this->assertSession()->linkByHrefExists('block/' . $block->id()); - $this->clickLink(t('Edit')); + $this->clickLink('Edit'); $this->assertSession()->statusCodeEquals(200); $this->assertSession()->titleEquals("Edit custom block $label | Drupal"); $edit = ['info[0][value]' => $new_label]; diff --git a/core/modules/block_content/tests/src/Functional/BlockContentListViewsTest.php b/core/modules/block_content/tests/src/Functional/BlockContentListViewsTest.php index 64b87f57210c..8be814433ea4 100644 --- a/core/modules/block_content/tests/src/Functional/BlockContentListViewsTest.php +++ b/core/modules/block_content/tests/src/Functional/BlockContentListViewsTest.php @@ -62,9 +62,7 @@ class BlockContentListViewsTest extends BlockContentTestBase { $label = 'Antelope'; $new_label = 'Albatross'; // Add a new entity using the operations link. - $link_text = t('Add custom block'); - $this->assertSession()->linkExists($link_text); - $this->clickLink($link_text); + $this->clickLink('Add custom block'); $this->assertSession()->statusCodeEquals(200); $edit = []; $edit['info[0][value]'] = $label; @@ -90,7 +88,7 @@ class BlockContentListViewsTest extends BlockContentTestBase { $block = reset($blocks); if (!empty($block)) { $this->assertSession()->linkByHrefExists('block/' . $block->id()); - $this->clickLink(t('Edit')); + $this->clickLink('Edit'); $this->assertSession()->statusCodeEquals(200); $this->assertSession()->titleEquals("Edit custom block $label | Drupal"); $edit = ['info[0][value]' => $new_label]; diff --git a/core/modules/block_content/tests/src/Functional/BlockContentTypeTest.php b/core/modules/block_content/tests/src/Functional/BlockContentTypeTest.php index fd39ef0fb123..937a63c488f4 100644 --- a/core/modules/block_content/tests/src/Functional/BlockContentTypeTest.php +++ b/core/modules/block_content/tests/src/Functional/BlockContentTypeTest.php @@ -222,7 +222,7 @@ class BlockContentTypeTest extends BlockContentTestBase { $path = $theme == $default_theme ? 'admin/structure/block' : "admin/structure/block/list/$theme"; $this->drupalGet($path); $this->clickLink('Place block'); - $this->clickLink(t('Add custom block')); + $this->clickLink('Add custom block'); // The seven theme has markup inside the link, we cannot use clickLink(). if ($default_theme == 'seven') { $options = $theme != $default_theme ? ['query' => ['theme' => $theme]] : []; @@ -251,7 +251,7 @@ class BlockContentTypeTest extends BlockContentTestBase { // Test that adding a block from the 'custom blocks list' doesn't send you // to the block configure form. $this->drupalGet('admin/structure/block/block-content'); - $this->clickLink(t('Add custom block')); + $this->clickLink('Add custom block'); $this->clickLink('foo'); $edit = ['info[0][value]' => $this->randomMachineName(8)]; $this->submitForm($edit, 'Save'); diff --git a/core/modules/block_content/tests/src/Functional/PageEditTest.php b/core/modules/block_content/tests/src/Functional/PageEditTest.php index f0af53494237..d35addb3e1a5 100644 --- a/core/modules/block_content/tests/src/Functional/PageEditTest.php +++ b/core/modules/block_content/tests/src/Functional/PageEditTest.php @@ -72,7 +72,7 @@ class PageEditTest extends BlockContentTestBase { // Test deleting the block. $this->drupalGet("block/" . $revised_block->id()); - $this->clickLink(t('Delete')); + $this->clickLink('Delete'); $this->assertSession()->pageTextContains('Are you sure you want to delete the custom block ' . $revised_block->label() . '?'); } diff --git a/core/modules/book/tests/src/Functional/BookTest.php b/core/modules/book/tests/src/Functional/BookTest.php index 1513675876c9..da9ee82ec0a5 100644 --- a/core/modules/book/tests/src/Functional/BookTest.php +++ b/core/modules/book/tests/src/Functional/BookTest.php @@ -251,7 +251,7 @@ class BookTest extends BrowserTestBase { // Log in as web user and view printer-friendly version. $this->drupalLogin($this->webUser); $this->drupalGet('node/' . $this->book->id()); - $this->clickLink(t('Printer-friendly version')); + $this->clickLink('Printer-friendly version'); // Make sure each part of the book is there. foreach ($nodes as $node) { @@ -513,7 +513,7 @@ class BookTest extends BrowserTestBase { $this->drupalLogin($this->adminUser); $this->drupalGet('node/' . $book->id() . '/outline'); $this->assertRaw(t('Book outline')); - $this->clickLink(t('Remove from book outline')); + $this->clickLink('Remove from book outline'); $this->assertRaw(t('Are you sure you want to remove %title from the book hierarchy?', ['%title' => $book->label()])); // Create a new node and set the book after the node was created. diff --git a/core/modules/comment/tests/src/Functional/CommentAdminTest.php b/core/modules/comment/tests/src/Functional/CommentAdminTest.php index 32f9d3574934..cb0ef684945f 100644 --- a/core/modules/comment/tests/src/Functional/CommentAdminTest.php +++ b/core/modules/comment/tests/src/Functional/CommentAdminTest.php @@ -167,7 +167,7 @@ class CommentAdminTest extends CommentTestBase { $this->drupalGet('comment/1/edit'); $this->assertSession()->checkboxChecked('edit-status-0'); $this->drupalGet('node/' . $this->node->id()); - $this->clickLink(t('Approve')); + $this->clickLink('Approve'); $this->drupalLogout(); $this->drupalGet('node/' . $this->node->id()); diff --git a/core/modules/config/tests/src/Functional/ConfigEntityListTest.php b/core/modules/config/tests/src/Functional/ConfigEntityListTest.php index 388de1218a20..7a1525b1b2af 100644 --- a/core/modules/config/tests/src/Functional/ConfigEntityListTest.php +++ b/core/modules/config/tests/src/Functional/ConfigEntityListTest.php @@ -277,7 +277,7 @@ class ConfigEntityListTest extends BrowserTestBase { $this->assertNoRaw('Test config entity 51'); // Browse to the next page, test config entity 51 is on page 2. - $this->clickLink(t('Page 2')); + $this->clickLink('Page 2'); $this->assertNoRaw('Test config entity 50'); $this->assertRaw('dotted.default'); $this->assertRaw('Test config entity 51'); diff --git a/core/modules/config/tests/src/Functional/ConfigEntityTest.php b/core/modules/config/tests/src/Functional/ConfigEntityTest.php index 750b3d601a7e..e170c3e14c1c 100644 --- a/core/modules/config/tests/src/Functional/ConfigEntityTest.php +++ b/core/modules/config/tests/src/Functional/ConfigEntityTest.php @@ -266,7 +266,7 @@ class ConfigEntityTest extends BrowserTestBase { // Delete the configuration entity. $this->drupalGet("admin/structure/config_test/manage/$id"); - $this->clickLink(t('Delete')); + $this->clickLink('Delete'); $this->assertSession()->addressEquals("admin/structure/config_test/manage/$id/delete"); $this->submitForm([], 'Delete'); $this->assertSession()->addressEquals('admin/structure/config_test'); diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php index d577748a7b7e..79f676676ae8 100644 --- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php +++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php @@ -151,14 +151,14 @@ class ConfigTranslationUiTest extends BrowserTestBase { // Check that the 'Edit' link in the source language links back to the // original form. - $this->clickLink(t('Edit')); + $this->clickLink('Edit'); // Also check that saving the form leads back to the translation overview. $this->submitForm([], 'Save configuration'); $this->assertSession()->addressEquals($translation_base_url); // Check 'Add' link of French to visit add page. $this->assertSession()->linkByHrefExists("$translation_base_url/fr/add"); - $this->clickLink(t('Add')); + $this->clickLink('Add'); // Make sure original text is present on this page. $this->assertRaw($site_name); @@ -613,7 +613,7 @@ class ConfigTranslationUiTest extends BrowserTestBase { // Check 'Add' link of French to visit add page. $this->assertSession()->linkByHrefExists("$translation_base_url/fr/add"); - $this->clickLink(t('Add')); + $this->clickLink('Add'); // Make sure original text is present on this page. $this->assertRaw($description); diff --git a/core/modules/contact/tests/src/Functional/ContactSitewideTest.php b/core/modules/contact/tests/src/Functional/ContactSitewideTest.php index 64366a48af33..586e6203edd6 100644 --- a/core/modules/contact/tests/src/Functional/ContactSitewideTest.php +++ b/core/modules/contact/tests/src/Functional/ContactSitewideTest.php @@ -289,7 +289,7 @@ class ContactSitewideTest extends BrowserTestBase { $contact_form = mb_strtolower($this->randomMachineName(16)); $this->addContactForm($contact_form, $label, $recipients, '', FALSE); $this->drupalGet('admin/structure/contact'); - $this->clickLink(t('Edit')); + $this->clickLink('Edit'); $this->assertSession()->statusCodeEquals(200); $this->assertSession()->fieldValueEquals('label', $label); @@ -315,7 +315,7 @@ class ContactSitewideTest extends BrowserTestBase { } $this->assertSession()->statusCodeEquals(200); - $this->clickLink(t('Add field')); + $this->clickLink('Add field'); $this->assertSession()->statusCodeEquals(200); // Create a simple textfield. diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php b/core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php index 432e596d9a4a..a23011d2137f 100644 --- a/core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php +++ b/core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php @@ -79,7 +79,7 @@ class ModerationLocaleTest extends ModerationStateTestBase { // Add a French translation. $this->drupalGet('node/' . $english_node->id() . '/translations'); - $this->clickLink(t('Add')); + $this->clickLink('Add'); $edit = [ 'title[0][value]' => 'French node Draft', 'moderation_state[0][state]' => 'draft', @@ -103,7 +103,7 @@ class ModerationLocaleTest extends ModerationStateTestBase { // Add a French translation. $this->drupalGet('node/' . $english_node->id() . '/translations'); - $this->clickLink(t('Add')); + $this->clickLink('Add'); $edit = [ 'title[0][value]' => 'French node', 'moderation_state[0][state]' => 'draft', @@ -139,7 +139,7 @@ class ModerationLocaleTest extends ModerationStateTestBase { // Add a French translation. $this->drupalGet('node/' . $english_node->id() . '/translations'); - $this->clickLink(t('Add')); + $this->clickLink('Add'); $edit = [ 'title[0][value]' => 'Translated node', 'moderation_state[0][state]' => 'draft', @@ -231,7 +231,7 @@ class ModerationLocaleTest extends ModerationStateTestBase { // Add a French translation draft (revision 3). $this->drupalGet($translate_path); - $this->clickLink(t('Add')); + $this->clickLink('Add'); $this->submitNodeForm('Test 1.3 FR', 'draft'); $fr_node = $this->loadTranslation($node, 'fr'); $this->assertLatestVersionPage($fr_node); @@ -239,7 +239,7 @@ class ModerationLocaleTest extends ModerationStateTestBase { // Add an Italian translation draft (revision 4). $this->drupalGet($translate_path); - $this->clickLink(t('Add')); + $this->clickLink('Add'); $this->submitNodeForm('Test 1.4 IT', 'draft'); $it_node = $this->loadTranslation($node, 'it'); $this->assertLatestVersionPage($it_node); @@ -255,7 +255,7 @@ class ModerationLocaleTest extends ModerationStateTestBase { // Publish the Italian draft (revision 6). $this->drupalGet($translate_path); - $this->clickLink(t('Edit'), 2); + $this->clickLink('Edit', 2); $this->submitNodeForm('Test 1.6 IT', 'published'); $this->assertNotLatestVersionPage($it_node); $this->assertNoModerationForm($node); @@ -263,7 +263,7 @@ class ModerationLocaleTest extends ModerationStateTestBase { // Publish the French draft (revision 7). $this->drupalGet($translate_path); - $this->clickLink(t('Edit'), 1); + $this->clickLink('Edit', 1); $this->submitNodeForm('Test 1.7 FR', 'published'); $this->assertNotLatestVersionPage($fr_node); $this->assertNoModerationForm($node); @@ -271,7 +271,7 @@ class ModerationLocaleTest extends ModerationStateTestBase { // Create an Italian draft (revision 8). $this->drupalGet($translate_path); - $this->clickLink(t('Edit'), 2); + $this->clickLink('Edit', 2); $this->submitNodeForm('Test 1.8 IT', 'draft'); $this->assertLatestVersionPage($it_node); $this->assertNoModerationForm($node); @@ -279,7 +279,7 @@ class ModerationLocaleTest extends ModerationStateTestBase { // Create a French draft (revision 9). $this->drupalGet($translate_path); - $this->clickLink(t('Edit'), 1); + $this->clickLink('Edit', 1); $this->submitNodeForm('Test 1.9 FR', 'draft'); $this->assertLatestVersionPage($fr_node); $this->assertNoModerationForm($node); @@ -302,7 +302,7 @@ class ModerationLocaleTest extends ModerationStateTestBase { // Add a French translation (revision 2). $this->drupalGet($translate_path); - $this->clickLink(t('Add')); + $this->clickLink('Add'); $this->submitNodeForm('Test 2.2 FR', 'draft'); $fr_node2 = $this->loadTranslation($node2, 'fr'); $this->assertNotLatestVersionPage($fr_node2, TRUE); @@ -310,7 +310,7 @@ class ModerationLocaleTest extends ModerationStateTestBase { // Add an Italian translation (revision 3). $this->drupalGet($translate_path); - $this->clickLink(t('Add')); + $this->clickLink('Add'); $this->submitNodeForm('Test 2.3 IT', 'draft'); $it_node2 = $this->loadTranslation($node2, 'it'); $this->assertNotLatestVersionPage($it_node2, TRUE); @@ -326,7 +326,7 @@ class ModerationLocaleTest extends ModerationStateTestBase { // Publish the Italian draft (revision 5). $this->drupalGet($translate_path); - $this->clickLink(t('Edit'), 2); + $this->clickLink('Edit', 2); $this->submitNodeForm('Test 2.5 IT', 'published'); $this->assertNotLatestVersionPage($it_node2); $this->assertNoModerationForm($node2); @@ -334,7 +334,7 @@ class ModerationLocaleTest extends ModerationStateTestBase { // Publish the French draft (revision 6). $this->drupalGet($translate_path); - $this->clickLink(t('Edit'), 1); + $this->clickLink('Edit', 1); $this->submitNodeForm('Test 2.6 FR', 'published'); $this->assertNotLatestVersionPage($fr_node2); $this->assertNoModerationForm($node2); @@ -358,7 +358,7 @@ class ModerationLocaleTest extends ModerationStateTestBase { // Create an Italian draft (revision 7). $this->drupalGet($translate_path); - $this->clickLink(t('Edit'), 2); + $this->clickLink('Edit', 2); $this->submitNodeForm('Test 2.7 IT', 'draft'); $this->assertLatestVersionPage($it_node2); $this->assertNoModerationForm($node2); @@ -366,7 +366,7 @@ class ModerationLocaleTest extends ModerationStateTestBase { // Create a French draft (revision 8). $this->drupalGet($translate_path); - $this->clickLink(t('Edit'), 1); + $this->clickLink('Edit', 1); $this->submitNodeForm('Test 2.8 FR', 'draft'); $this->assertLatestVersionPage($fr_node2); $this->assertNoModerationForm($node2); @@ -395,7 +395,7 @@ class ModerationLocaleTest extends ModerationStateTestBase { // Add a French translation (revision 3). $this->drupalGet($translate_path); - $this->clickLink(t('Add')); + $this->clickLink('Add'); $this->submitNodeForm('Test 3.3 FR', 'draft'); $fr_node3 = $this->loadTranslation($node3, 'fr'); $this->assertLatestVersionPage($fr_node3); @@ -403,7 +403,7 @@ class ModerationLocaleTest extends ModerationStateTestBase { // Publish the French draft (revision 4). $this->drupalGet($translate_path); - $this->clickLink(t('Edit'), 1); + $this->clickLink('Edit', 1); $this->submitNodeForm('Test 3.4 FR', 'published'); $this->assertNotLatestVersionPage($fr_node3); $this->assertModerationForm($node3); diff --git a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php index 1d4d09f3eb4d..7877ce87b56d 100644 --- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php +++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php @@ -93,7 +93,7 @@ class EntityReferenceAdminTest extends BrowserTestBase { $this->drupalGet('admin/structure/views/add'); $this->submitForm($edit, 'Save and edit'); $this->submitForm([], 'Duplicate as Entity Reference'); - $this->clickLink(t('Settings')); + $this->clickLink('Settings'); $edit = [ 'style_options[search_fields][title]' => 'title', ]; @@ -109,7 +109,7 @@ class EntityReferenceAdminTest extends BrowserTestBase { $this->drupalGet('admin/structure/views/view/node_test_view/edit/entity_reference_1'); $this->submitForm([], 'Save'); - $this->clickLink(t('Settings')); + $this->clickLink('Settings'); // Create a test entity reference field. $field_name = 'test_entity_ref_field'; diff --git a/core/modules/field/tests/src/FunctionalJavascript/EntityReference/EntityReferenceAdminTest.php b/core/modules/field/tests/src/FunctionalJavascript/EntityReference/EntityReferenceAdminTest.php index 3715714d4dfd..3273c7a15321 100644 --- a/core/modules/field/tests/src/FunctionalJavascript/EntityReference/EntityReferenceAdminTest.php +++ b/core/modules/field/tests/src/FunctionalJavascript/EntityReference/EntityReferenceAdminTest.php @@ -258,7 +258,7 @@ class EntityReferenceAdminTest extends WebDriverTestBase { // Check that the field settings form can be submitted again, even when the // field is required. // The first 'Edit' link is for the Body field. - $this->clickLink(t('Edit'), 1); + $this->clickLink('Edit', 1); $this->submitForm([], 'Save settings'); // Switch the target type to 'taxonomy_term' and check that the settings diff --git a/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php b/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php index 06cb7b74d9a4..d49bdfb1e126 100644 --- a/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php +++ b/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php @@ -63,7 +63,7 @@ class EntityDisplayModeTest extends BrowserTestBase { $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')); + $this->clickLink('Test entity'); $edit = [ 'id' => strtolower($this->randomMachineName()) . '.' . strtolower($this->randomMachineName()), 'label' => $this->randomString(), @@ -91,7 +91,7 @@ class EntityDisplayModeTest extends BrowserTestBase { $this->assertEquals(Url::fromRoute('entity.entity_view_mode.delete_form', ['entity_view_mode' => $view_mode->id()])->toString(), $view_mode->toUrl('delete-form')->toString()); // Test deleting the view mode. - $this->clickLink(t('Delete')); + $this->clickLink('Delete'); $this->assertRaw(t('Are you sure you want to delete the view mode %label?', ['%label' => $edit['label']])); $this->submitForm([], 'Delete'); $this->assertRaw(t('The view mode %label has been deleted.', ['%label' => $edit['label']])); @@ -117,7 +117,7 @@ class EntityDisplayModeTest extends BrowserTestBase { $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')); + $this->clickLink('Test entity'); $edit = [ 'id' => strtolower($this->randomMachineName()) . '.' . strtolower($this->randomMachineName()), 'label' => $this->randomString(), @@ -145,7 +145,7 @@ class EntityDisplayModeTest extends BrowserTestBase { $this->assertEquals(Url::fromRoute('entity.entity_form_mode.delete_form', ['entity_form_mode' => $form_mode->id()])->toString(), $form_mode->toUrl('delete-form')->toString()); // Test deleting the form mode. - $this->clickLink(t('Delete')); + $this->clickLink('Delete'); $this->assertRaw(t('Are you sure you want to delete the form mode %label?', ['%label' => $edit['label']])); $this->submitForm([], 'Delete'); $this->assertRaw(t('The form mode %label has been deleted.', ['%label' => $edit['label']])); diff --git a/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php b/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php index 7ee3bc7f6062..f3828b8fb25f 100644 --- a/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php +++ b/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php @@ -412,7 +412,7 @@ class ManageFieldsFunctionalTest extends BrowserTestBase { // Delete the field. $field_id = 'node.' . $this->contentType . '.' . $this->fieldName; $this->drupalGet('admin/structure/types/manage/' . $this->contentType . '/fields/' . $field_id); - $this->clickLink(t('Delete')); + $this->clickLink('Delete'); $this->assertSession()->statusCodeEquals(200); } @@ -427,7 +427,7 @@ class ManageFieldsFunctionalTest extends BrowserTestBase { foreach ($field_storage->getBundles() as $node_type) { // Delete all the body field instances. $this->drupalGet('admin/structure/types/manage/' . $node_type . '/fields/node.' . $node_type . '.' . $this->fieldName); - $this->clickLink(t('Delete')); + $this->clickLink('Delete'); $this->submitForm([], 'Delete'); } // Check "Re-use existing field" appears. diff --git a/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php b/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php index 48267e0e0cf7..05fea4a159c6 100644 --- a/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php +++ b/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php @@ -113,7 +113,7 @@ class FileFieldDisplayTest extends FileFieldTestBase { $edit[$field_name . '[0][display]'] = FALSE; $edit[$field_name . '[1][display]'] = FALSE; $this->submitForm($edit, 'Preview'); - $this->clickLink(t('Back to content editing')); + $this->clickLink('Back to content editing'); // First file. $this->assertRaw($field_name . '[0][display]'); // Second file. diff --git a/core/modules/file/tests/src/Functional/PrivateFileOnTranslatedEntityTest.php b/core/modules/file/tests/src/Functional/PrivateFileOnTranslatedEntityTest.php index 70500cb5f2bb..412647be9ac0 100644 --- a/core/modules/file/tests/src/Functional/PrivateFileOnTranslatedEntityTest.php +++ b/core/modules/file/tests/src/Functional/PrivateFileOnTranslatedEntityTest.php @@ -103,7 +103,7 @@ class PrivateFileOnTranslatedEntityTest extends FileFieldTestBase { // Translate the node into French. $this->drupalGet('node/' . $default_language_node->id() . '/translations'); - $this->clickLink(t('Add')); + $this->clickLink('Add'); // Remove the existing file. $this->submitForm([], 'Remove'); diff --git a/core/modules/filter/tests/src/Functional/FilterFormatAccessTest.php b/core/modules/filter/tests/src/Functional/FilterFormatAccessTest.php index 6d1e3131169f..4d2284b80256 100644 --- a/core/modules/filter/tests/src/Functional/FilterFormatAccessTest.php +++ b/core/modules/filter/tests/src/Functional/FilterFormatAccessTest.php @@ -226,7 +226,7 @@ class FilterFormatAccessTest extends BrowserTestBase { // Try to edit with a less privileged user. $this->drupalLogin($this->webUser); $this->drupalGet('node/' . $node->id()); - $this->clickLink(t('Edit')); + $this->clickLink('Edit'); // Verify that body field is read-only and contains replacement value. $this->assertSession()->fieldDisabled($body_value_key); diff --git a/core/modules/forum/tests/src/Functional/ForumIndexTest.php b/core/modules/forum/tests/src/Functional/ForumIndexTest.php index 92ff81731c4f..cdc7a71d7611 100644 --- a/core/modules/forum/tests/src/Functional/ForumIndexTest.php +++ b/core/modules/forum/tests/src/Functional/ForumIndexTest.php @@ -53,7 +53,7 @@ class ForumIndexTest extends BrowserTestBase { // Create the forum topic, preselecting the forum ID via a URL parameter. $this->drupalGet("forum/$tid"); - $this->clickLink(t('Add new @node_type', ['@node_type' => 'Forum topic'])); + $this->clickLink('Add new Forum topic'); $this->assertSession()->addressEquals("node/add/forum?forum_id=$tid"); $this->submitForm($edit, 'Save'); diff --git a/core/modules/forum/tests/src/Functional/ForumTest.php b/core/modules/forum/tests/src/Functional/ForumTest.php index 0a43e1857dd1..eb212ad92a94 100644 --- a/core/modules/forum/tests/src/Functional/ForumTest.php +++ b/core/modules/forum/tests/src/Functional/ForumTest.php @@ -489,7 +489,7 @@ class ForumTest extends BrowserTestBase { public function deleteForum($tid) { // Delete the forum. $this->drupalGet('admin/structure/forum/edit/forum/' . $tid); - $this->clickLink(t('Delete')); + $this->clickLink('Delete'); $this->assertSession()->pageTextContains('Are you sure you want to delete the forum'); $this->assertNoText('Add forum'); $this->assertNoText('Add forum container'); diff --git a/core/modules/forum/tests/src/Functional/ForumUninstallTest.php b/core/modules/forum/tests/src/Functional/ForumUninstallTest.php index 8d2c9651f8e1..440d3b9f94a8 100644 --- a/core/modules/forum/tests/src/Functional/ForumUninstallTest.php +++ b/core/modules/forum/tests/src/Functional/ForumUninstallTest.php @@ -123,7 +123,7 @@ class ForumUninstallTest extends BrowserTestBase { $this->submitForm($edit, 'Save content type'); $this->assertTrue((bool) NodeType::load('forum'), 'Node type with machine forum created.'); $this->drupalGet('admin/structure/types/manage/forum'); - $this->clickLink(t('Delete')); + $this->clickLink('Delete'); $this->submitForm([], 'Delete'); $this->assertSession()->statusCodeEquals(200); $this->assertFalse((bool) NodeType::load('forum'), 'Node type with machine forum deleted.'); diff --git a/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php b/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php index 27f005ed02d7..3b2bd1e42567 100644 --- a/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php +++ b/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php @@ -389,7 +389,7 @@ class ImageAdminStylesTest extends ImageFieldTestBase { $this->assertSession()->pageTextContains('Scale and crop 300×200'); // There should normally be only one edit link on this page initially. - $this->clickLink(t('Edit')); + $this->clickLink('Edit'); $this->submitForm(['data[width]' => '360', 'data[height]' => '240'], 'Update effect'); $this->assertSession()->pageTextContains('Scale and crop 360×240'); @@ -403,7 +403,7 @@ class ImageAdminStylesTest extends ImageFieldTestBase { $this->submitForm(['data[width]' => '12', 'data[height]' => '19'], 'Add effect'); // Edit the scale effect that was just added. - $this->clickLink(t('Edit')); + $this->clickLink('Edit'); $this->submitForm(['data[width]' => '24', 'data[height]' => '19'], 'Update effect'); // Add another scale effect and make sure both exist. Click through from @@ -519,7 +519,7 @@ class ImageAdminStylesTest extends ImageFieldTestBase { $style->save(); $this->drupalGet('admin/config/media/image-styles'); - $this->clickLink(t('Edit')); + $this->clickLink('Edit'); $this->assertRaw(t('Select a new effect')); } diff --git a/core/modules/language/tests/src/Functional/LanguageListTest.php b/core/modules/language/tests/src/Functional/LanguageListTest.php index 2c94ce29dd46..d1960c3ddad3 100644 --- a/core/modules/language/tests/src/Functional/LanguageListTest.php +++ b/core/modules/language/tests/src/Functional/LanguageListTest.php @@ -97,7 +97,7 @@ class LanguageListTest extends BrowserTestBase { // Ensure 'Edit' link works. $this->drupalGet('admin/config/regional/language'); - $this->clickLink(t('Edit')); + $this->clickLink('Edit'); $this->assertSession()->titleEquals('Edit language | Drupal'); // Edit a language. $name = $this->randomMachineName(16); @@ -118,12 +118,12 @@ class LanguageListTest extends BrowserTestBase { $this->rebuildContainer(); // Ensure 'delete' link works. $this->drupalGet('admin/config/regional/language'); - $this->clickLink(t('Delete')); + $this->clickLink('Delete'); $this->assertSession()->pageTextContains('Are you sure you want to delete the language'); // Delete a language. $this->drupalGet('admin/config/regional/language/delete/' . $langcode); // First test the 'cancel' link. - $this->clickLink(t('Cancel')); + $this->clickLink('Cancel'); $this->assertSession()->addressEquals(Url::fromRoute('entity.configurable_language.collection', [], ['language' => $english])); $this->assertRaw($name); // Delete the language for real. This a confirm form, we do not need any diff --git a/core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php b/core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php index 4755cbf5c479..fc8149881125 100644 --- a/core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php +++ b/core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php @@ -78,7 +78,7 @@ class LanguagePathMonolingualTest extends BrowserTestBase { $this->assertSession()->linkByHrefNotExists('/fr/', 'Links do not contain language prefix'); // Verify that links in this page can be followed and work. - $this->clickLink(t('Languages')); + $this->clickLink('Languages'); $this->assertSession()->statusCodeEquals(200); $this->assertSession()->pageTextContains('Add language'); } diff --git a/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php b/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php index cc0ae0ec09c4..d9b7ce5af684 100644 --- a/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php +++ b/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php @@ -451,15 +451,15 @@ class LanguageSwitchingTest extends BrowserTestBase { // Go to the homepage. $this->drupalGet(''); // Click on the French link. - $this->clickLink(t('French')); + $this->clickLink('French'); // There should be a query parameter to set the session language. $this->assertSession()->addressEquals('user/2?language=fr'); // Click on the 'Home' Link. - $this->clickLink(t('Home')); + $this->clickLink('Home'); // There should be no query parameter. $this->assertSession()->addressEquals('user/2'); // Click on the French link. - $this->clickLink(t('French')); + $this->clickLink('French'); // There should be no query parameter. $this->assertSession()->addressEquals('user/2'); } diff --git a/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php b/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php index 9840afea1250..665c937f4883 100644 --- a/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php +++ b/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php @@ -291,18 +291,18 @@ class MenuUiTest extends BrowserTestBase { // Test the 'Add link' local action. $this->drupalGet(Url::fromRoute('entity.menu.edit_form', ['menu' => $menu_name])); - $this->clickLink(t('Add link')); + $this->clickLink('Add link'); $link_title = $this->randomString(); $this->submitForm(['link[0][uri]' => '/', 'title[0][value]' => $link_title], 'Save'); $this->assertSession()->addressEquals(Url::fromRoute('entity.menu.edit_form', ['menu' => $menu_name])); // Test the 'Edit' operation. - $this->clickLink(t('Edit')); + $this->clickLink('Edit'); $this->assertSession()->fieldValueEquals('title[0][value]', $link_title); $link_title = $this->randomString(); $this->submitForm(['title[0][value]' => $link_title], 'Save'); $this->assertSession()->addressEquals(Url::fromRoute('entity.menu.edit_form', ['menu' => $menu_name])); // Test the 'Delete' operation. - $this->clickLink(t('Delete')); + $this->clickLink('Delete'); $this->assertRaw(t('Are you sure you want to delete the custom menu link %item?', ['%item' => $link_title])); $this->submitForm([], 'Delete'); $this->assertSession()->addressEquals(Url::fromRoute('entity.menu.edit_form', ['menu' => $menu_name])); diff --git a/core/modules/node/tests/src/Functional/NodeAccessRebuildNodeGrantsTest.php b/core/modules/node/tests/src/Functional/NodeAccessRebuildNodeGrantsTest.php index fd3e8c5b107d..31fee1ccd26f 100644 --- a/core/modules/node/tests/src/Functional/NodeAccessRebuildNodeGrantsTest.php +++ b/core/modules/node/tests/src/Functional/NodeAccessRebuildNodeGrantsTest.php @@ -79,7 +79,7 @@ class NodeAccessRebuildNodeGrantsTest extends NodeTestBase { // Rebuild permissions. $this->drupalGet('admin/reports/status'); - $this->clickLink(t('Rebuild permissions')); + $this->clickLink('Rebuild permissions'); $this->submitForm([], 'Rebuild permissions'); $this->assertSession()->pageTextContains('The content access permissions have been rebuilt.'); @@ -115,7 +115,7 @@ class NodeAccessRebuildNodeGrantsTest extends NodeTestBase { // Rebuild permissions. $this->drupalGet('admin/reports/status'); - $this->clickLink(t('Rebuild permissions')); + $this->clickLink('Rebuild permissions'); $this->submitForm([], 'Rebuild permissions'); $this->assertSession()->pageTextContains('Content permissions have been rebuilt.'); $this->assertNull(\Drupal::state()->get('node.node_access_needs_rebuild'), 'Node access permissions have been rebuilt'); diff --git a/core/modules/node/tests/src/Functional/NodeActionsConfigurationTest.php b/core/modules/node/tests/src/Functional/NodeActionsConfigurationTest.php index 3e33ff2de57b..c069dbdcbadd 100644 --- a/core/modules/node/tests/src/Functional/NodeActionsConfigurationTest.php +++ b/core/modules/node/tests/src/Functional/NodeActionsConfigurationTest.php @@ -60,7 +60,7 @@ class NodeActionsConfigurationTest extends BrowserTestBase { $this->assertSession()->pageTextContains($action_label); // Make another POST request to the action edit page. - $this->clickLink(t('Configure')); + $this->clickLink('Configure'); $edit = []; $new_action_label = $this->randomMachineName(); $edit['label'] = $new_action_label; @@ -79,7 +79,7 @@ class NodeActionsConfigurationTest extends BrowserTestBase { // Make sure that deletions work properly. $this->drupalGet('admin/config/system/actions'); - $this->clickLink(t('Delete')); + $this->clickLink('Delete'); $this->assertSession()->statusCodeEquals(200); $edit = []; $this->submitForm($edit, 'Delete'); diff --git a/core/modules/node/tests/src/Functional/NodeEditFormTest.php b/core/modules/node/tests/src/Functional/NodeEditFormTest.php index 1ffec6774d36..305eb8cb5404 100644 --- a/core/modules/node/tests/src/Functional/NodeEditFormTest.php +++ b/core/modules/node/tests/src/Functional/NodeEditFormTest.php @@ -81,7 +81,7 @@ class NodeEditFormTest extends NodeTestBase { $this->assertNotEmpty($node, 'Node found in database.'); // Check that "edit" link points to correct page. - $this->clickLink(t('Edit')); + $this->clickLink('Edit'); $this->assertSession()->addressEquals($node->toUrl('edit-form')); // Check that the title and body fields are displayed with the correct values. diff --git a/core/modules/node/tests/src/Functional/NodeRevisionsAllTest.php b/core/modules/node/tests/src/Functional/NodeRevisionsAllTest.php index 1b209e3250c9..b772ad8dd774 100644 --- a/core/modules/node/tests/src/Functional/NodeRevisionsAllTest.php +++ b/core/modules/node/tests/src/Functional/NodeRevisionsAllTest.php @@ -229,7 +229,7 @@ class NodeRevisionsAllTest extends NodeTestBase { // Go to the second page and check that one of the initial three revisions // is displayed. - $this->clickLink(t('Page 2')); + $this->clickLink('Page 2'); $this->assertSession()->pageTextContains($logs[2]); } diff --git a/core/modules/node/tests/src/Functional/NodeTypeTest.php b/core/modules/node/tests/src/Functional/NodeTypeTest.php index 42a18ff5d747..a4c3154ff05f 100644 --- a/core/modules/node/tests/src/Functional/NodeTypeTest.php +++ b/core/modules/node/tests/src/Functional/NodeTypeTest.php @@ -222,7 +222,7 @@ class NodeTypeTest extends NodeTestBase { unset($locked['default']); \Drupal::state()->set('node.type.locked', $locked); $this->drupalGet('admin/structure/types/manage/default'); - $this->clickLink(t('Delete')); + $this->clickLink('Delete'); $this->assertSession()->statusCodeEquals(200); $this->submitForm([], 'Delete'); $this->assertFalse((bool) NodeType::load('default'), 'Node type with machine default deleted.'); diff --git a/core/modules/node/tests/src/Functional/PagePreviewTest.php b/core/modules/node/tests/src/Functional/PagePreviewTest.php index 1f544e520568..c57a276c7307 100644 --- a/core/modules/node/tests/src/Functional/PagePreviewTest.php +++ b/core/modules/node/tests/src/Functional/PagePreviewTest.php @@ -235,7 +235,7 @@ class PagePreviewTest extends NodeTestBase { // Check that the title, body and term fields are displayed with the // values after going back to the content edit page. - $this->clickLink(t('Back to content editing')); + $this->clickLink('Back to content editing'); $this->assertSession()->fieldValueEquals($title_key, $edit[$title_key]); $this->assertSession()->fieldValueEquals($body_key, $edit[$body_key]); $this->assertSession()->fieldValueEquals($term_key, $edit[$term_key]); @@ -313,7 +313,7 @@ class PagePreviewTest extends NodeTestBase { $this->drupalGet('node/' . $node->id() . '/edit'); $this->submitForm($edit, 'Preview'); $this->assertSession()->pageTextContains($edit[$title_key]); - $this->clickLink(t('Back to content editing')); + $this->clickLink('Back to content editing'); $this->assertSession()->fieldValueEquals($title_key, $edit[$title_key]); // Navigate away from the node without saving. $this->drupalGet(''); @@ -329,7 +329,7 @@ class PagePreviewTest extends NodeTestBase { $this->assertNoRaw('edit-submit'); $this->drupalGet('node/add/page'); $this->submitForm([$title_key => 'Preview'], 'Preview'); - $this->clickLink(t('Back to content editing')); + $this->clickLink('Back to content editing'); $this->assertRaw('edit-submit'); // Check that destination is remembered when clicking on preview. When going @@ -342,7 +342,7 @@ class PagePreviewTest extends NodeTestBase { $options = ['absolute' => TRUE, 'query' => ['destination' => $destination]]; $this->assertSession()->addressEquals(Url::fromRoute('entity.node.preview', $parameters, $options)); $this->submitForm(['view_mode' => 'teaser'], 'Switch'); - $this->clickLink(t('Back to content editing')); + $this->clickLink('Back to content editing'); $this->submitForm([], 'Save'); $this->assertSession()->addressEquals($destination); @@ -352,7 +352,7 @@ class PagePreviewTest extends NodeTestBase { $parameters = ['node_preview' => $node->uuid(), 'view_mode_id' => 'full']; $this->assertSession()->addressEquals(Url::fromRoute('entity.node.preview', $parameters)); $this->submitForm(['view_mode' => 'teaser'], 'Switch'); - $this->clickLink(t('Back to content editing')); + $this->clickLink('Back to content editing'); $this->submitForm([], 'Save'); $this->assertSession()->addressEquals($node->toUrl()); $this->assertSession()->statusCodeEquals(200); @@ -369,7 +369,7 @@ class PagePreviewTest extends NodeTestBase { $this->drupalGet('node/add/page'); $this->submitForm($edit_image_1, 'Upload'); $this->submitForm($edit, 'Preview'); - $this->clickLink(t('Back to content editing')); + $this->clickLink('Back to content editing'); $this->assertSession()->fieldExists('files[field_image_1][]'); $this->submitForm($edit_image_2, 'Upload'); $this->assertSession()->fieldNotExists('files[field_image_1][]'); @@ -385,7 +385,7 @@ class PagePreviewTest extends NodeTestBase { ]; $this->assertRaw('Storage is not set'); $this->submitForm($edit, 'Preview'); - $this->clickLink(t('Back to content editing')); + $this->clickLink('Back to content editing'); $this->assertRaw('Storage is set'); $this->assertSession()->fieldExists('field_test_multi[0][value]'); $this->submitForm([], 'Save'); @@ -399,9 +399,9 @@ class PagePreviewTest extends NodeTestBase { 'field_test_multi[2][value]' => $example_text_3, ]; $this->submitForm($edit, 'Preview'); - $this->clickLink(t('Back to content editing')); + $this->clickLink('Back to content editing'); $this->submitForm($edit, 'Preview'); - $this->clickLink(t('Back to content editing')); + $this->clickLink('Back to content editing'); $this->assertSession()->fieldValueEquals('field_test_multi[0][value]', $example_text_1); $this->assertSession()->fieldValueEquals('field_test_multi[1][value]', $example_text_2); $this->assertSession()->fieldValueEquals('field_test_multi[2][value]', $example_text_3); @@ -419,7 +419,7 @@ class PagePreviewTest extends NodeTestBase { 'menu[title]' => 'Changed title', ]; $this->submitForm($edit, 'Preview'); - $this->clickLink(t('Back to content editing')); + $this->clickLink('Back to content editing'); $this->assertSession()->checkboxChecked('edit-menu-enabled'); $this->assertSession()->fieldValueEquals('menu[title]', 'Changed title'); @@ -464,7 +464,7 @@ class PagePreviewTest extends NodeTestBase { // Check that the title and body fields are displayed with the correct // values after going back to the content edit page. - $this->clickLink(t('Back to content editing')); + $this->clickLink('Back to content editing'); $this->assertSession()->fieldValueEquals($title_key, $edit[$title_key]); $this->assertSession()->fieldValueEquals($body_key, $edit[$body_key]); $this->assertSession()->fieldValueEquals($term_key, $edit[$term_key]); @@ -529,7 +529,7 @@ class PagePreviewTest extends NodeTestBase { $this->drupalGet('/node/add/page'); $this->submitForm($edit, 'Preview'); $this->assertSession()->pageTextContains($edit[$title_key]); - $this->clickLink(t('Back to content editing')); + $this->clickLink('Back to content editing'); $edit = [ $title_key => $this->randomMachineName(8), diff --git a/core/modules/path/tests/src/Functional/PathAliasTest.php b/core/modules/path/tests/src/Functional/PathAliasTest.php index 0a0f1f045e07..439ef2570614 100644 --- a/core/modules/path/tests/src/Functional/PathAliasTest.php +++ b/core/modules/path/tests/src/Functional/PathAliasTest.php @@ -161,7 +161,7 @@ class PathAliasTest extends PathTestBase { // Delete alias. $this->drupalGet('admin/config/search/path/edit/' . $pid); - $this->clickLink(t('Delete')); + $this->clickLink('Delete'); $this->assertRaw(t('Are you sure you want to delete the URL alias %name?', ['%name' => $edit['alias[0][value]']])); $this->submitForm([], 'Delete'); diff --git a/core/modules/path/tests/src/Functional/PathLanguageTest.php b/core/modules/path/tests/src/Functional/PathLanguageTest.php index 764313a91b7b..bbf2cd62f2cb 100644 --- a/core/modules/path/tests/src/Functional/PathLanguageTest.php +++ b/core/modules/path/tests/src/Functional/PathLanguageTest.php @@ -100,7 +100,7 @@ class PathLanguageTest extends PathTestBase { // Translate the node into French. $this->drupalGet('node/' . $english_node->id() . '/translations'); - $this->clickLink(t('Add')); + $this->clickLink('Add'); $edit = []; $edit['title[0][value]'] = $this->randomMachineName(); diff --git a/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php b/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php index f382af7aadbf..27dcbcfffb97 100644 --- a/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php +++ b/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php @@ -137,7 +137,7 @@ class SearchConfigSettingsFormTest extends BrowserTestBase { */ public function testSearchModuleSettingsPage() { $this->drupalGet('admin/config/search/pages'); - $this->clickLink(t('Edit'), 1); + $this->clickLink('Edit', 1); // Ensure that the default setting was picked up from the default config $this->assertTrue($this->assertSession()->optionExists('edit-extra-type-settings-boost', 'bi')->isSelected()); @@ -324,26 +324,26 @@ class SearchConfigSettingsFormTest extends BrowserTestBase { $this->verifySearchPageOperations($second_id, TRUE, TRUE, TRUE, FALSE); // Change the default search page. - $this->clickLink(t('Set as default')); + $this->clickLink('Set as default'); $this->assertRaw(t('The default search page is now %label. Be sure to check the ordering of your search pages.', ['%label' => $second['label']])); $this->verifySearchPageOperations($first_id, TRUE, TRUE, TRUE, FALSE); $this->verifySearchPageOperations($second_id, TRUE, FALSE, FALSE, FALSE); // Disable the first search page. - $this->clickLink(t('Disable')); + $this->clickLink('Disable'); $this->assertSession()->statusCodeEquals(200); $this->assertSession()->linkNotExists('Disable'); $this->verifySearchPageOperations($first_id, TRUE, TRUE, FALSE, TRUE); $this->verifySearchPageOperations($second_id, TRUE, FALSE, FALSE, FALSE); // Enable the first search page. - $this->clickLink(t('Enable')); + $this->clickLink('Enable'); $this->assertSession()->statusCodeEquals(200); $this->verifySearchPageOperations($first_id, TRUE, TRUE, TRUE, FALSE); $this->verifySearchPageOperations($second_id, TRUE, FALSE, FALSE, FALSE); // Test deleting. - $this->clickLink(t('Delete')); + $this->clickLink('Delete'); $this->assertRaw(t('Are you sure you want to delete the search page %label?', ['%label' => $first['label']])); $this->submitForm([], 'Delete'); $this->assertRaw(t('The search page %label has been deleted.', ['%label' => $first['label']])); diff --git a/core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php b/core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php index 37b3c302073f..8c2d21aaeb7b 100644 --- a/core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php +++ b/core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php @@ -37,7 +37,7 @@ class ShortcutSetsTest extends ShortcutTestBase { */ public function testShortcutSetAdd() { $this->drupalGet('admin/config/user-interface/shortcut'); - $this->clickLink(t('Add shortcut set')); + $this->clickLink('Add shortcut set'); $edit = [ 'label' => $this->randomMachineName(), 'id' => strtolower($this->randomMachineName()), @@ -165,7 +165,7 @@ class ShortcutSetsTest extends ShortcutTestBase { $new_label = $this->randomMachineName(); $this->drupalGet('admin/config/user-interface/shortcut'); - $this->clickLink(t('Edit shortcut set')); + $this->clickLink('Edit shortcut set'); $this->submitForm(['label' => $new_label], 'Save'); $set = ShortcutSet::load($set->id()); $this->assertSame($new_label, $set->label(), 'Shortcut set has been successfully renamed.'); diff --git a/core/modules/system/tests/src/Functional/Entity/EntityAddUITest.php b/core/modules/system/tests/src/Functional/Entity/EntityAddUITest.php index 03aad8f7063f..bab3d7760f98 100644 --- a/core/modules/system/tests/src/Functional/Entity/EntityAddUITest.php +++ b/core/modules/system/tests/src/Functional/Entity/EntityAddUITest.php @@ -96,7 +96,7 @@ class EntityAddUITest extends BrowserTestBase { $this->assertSession()->linkExists('Test label'); $this->assertSession()->linkExists('Test2 label'); $this->assertSession()->linkNotExists('Test3 label'); - $this->clickLink(t('Test label')); + $this->clickLink('Test label'); $this->assertSession()->statusCodeEquals(200); // Without any permissions, access must be denied. diff --git a/core/modules/system/tests/src/Functional/Entity/EntityFormTest.php b/core/modules/system/tests/src/Functional/Entity/EntityFormTest.php index 5345ce2df7db..a140b8e3af88 100644 --- a/core/modules/system/tests/src/Functional/Entity/EntityFormTest.php +++ b/core/modules/system/tests/src/Functional/Entity/EntityFormTest.php @@ -136,7 +136,7 @@ class EntityFormTest extends BrowserTestBase { $this->assertNotEquals($name1, $entity->name->value, new FormattableMarkup('%entity_type: The entity name has been modified.', ['%entity_type' => $entity_type])); $this->drupalGet($entity_type . '/manage/' . $entity->id() . '/edit'); - $this->clickLink(t('Delete')); + $this->clickLink('Delete'); $this->submitForm([], 'Delete'); $entity = $this->loadEntityByName($entity_type, $name2); $this->assertNull($entity, new FormattableMarkup('%entity_type: Entity not found in the database.', ['%entity_type' => $entity_type])); @@ -177,7 +177,7 @@ class EntityFormTest extends BrowserTestBase { $this->assertEquals($name2_ro, $translated_entity->name->value, new FormattableMarkup('%entity_type: The name of the translation has been modified.', ['%entity_type' => $entity_type_id])); $this->drupalGet('ro/' . $entity_type_id . '/manage/' . $entity->id() . '/edit'); - $this->clickLink(t('Delete')); + $this->clickLink('Delete'); $this->submitForm([], 'Delete Romanian translation'); $entity = $this->loadEntityByName($entity_type_id, $name1); $this->assertNotNull($entity, new FormattableMarkup('%entity_type: The original entity still exists.', ['%entity_type' => $entity_type_id])); diff --git a/core/modules/system/tests/src/Functional/Entity/EntityListBuilderTest.php b/core/modules/system/tests/src/Functional/Entity/EntityListBuilderTest.php index fca46b860391..12da4112a5ee 100644 --- a/core/modules/system/tests/src/Functional/Entity/EntityListBuilderTest.php +++ b/core/modules/system/tests/src/Functional/Entity/EntityListBuilderTest.php @@ -53,7 +53,7 @@ class EntityListBuilderTest extends BrowserTestBase { $this->assertNoRaw('Test entity 51'); // Browse to the next page, test entity 51 is shown. - $this->clickLink(t('Page 2')); + $this->clickLink('Page 2'); $this->assertNoRaw('Test entity 50'); $this->assertRaw('Test entity 51'); } diff --git a/core/modules/system/tests/src/Functional/Form/ConfirmFormTest.php b/core/modules/system/tests/src/Functional/Form/ConfirmFormTest.php index 684728abc356..5be7c331889d 100644 --- a/core/modules/system/tests/src/Functional/Form/ConfirmFormTest.php +++ b/core/modules/system/tests/src/Functional/Form/ConfirmFormTest.php @@ -34,7 +34,7 @@ class ConfirmFormTest extends BrowserTestBase { $this->assertSession()->buttonExists('ConfirmFormTestForm::getConfirmText().'); // Test cancelling the form. - $this->clickLink(t('ConfirmFormTestForm::getCancelText().')); + $this->clickLink('ConfirmFormTestForm::getCancelText().'); $this->assertSession()->addressEquals('form-test/autocomplete'); // Test submitting the form. @@ -50,7 +50,7 @@ class ConfirmFormTest extends BrowserTestBase { // Test cancelling the form with a complex destination. $this->drupalGet('form-test/confirm-form-array-path'); - $this->clickLink(t('ConfirmFormArrayPathTestForm::getCancelText().')); + $this->clickLink('ConfirmFormArrayPathTestForm::getCancelText().'); // Verify that the form's complex cancel link was followed. $this->assertSession()->addressEquals('form-test/confirm-form?destination=admin/config'); } diff --git a/core/modules/system/tests/src/Functional/System/CronRunTest.php b/core/modules/system/tests/src/Functional/System/CronRunTest.php index 899e64705e78..72776c16eec0 100644 --- a/core/modules/system/tests/src/Functional/System/CronRunTest.php +++ b/core/modules/system/tests/src/Functional/System/CronRunTest.php @@ -146,7 +146,7 @@ class CronRunTest extends BrowserTestBase { $this->assertSession()->statusCodeEquals(403); $this->drupalGet('admin/reports/status'); - $this->clickLink(t('Run cron')); + $this->clickLink('Run cron'); $this->assertSession()->statusCodeEquals(200); $this->assertSession()->pageTextContains('Cron ran successfully.'); } diff --git a/core/modules/system/tests/src/Functional/System/DateTimeTest.php b/core/modules/system/tests/src/Functional/System/DateTimeTest.php index 1e06c995da93..690a469fb7af 100644 --- a/core/modules/system/tests/src/Functional/System/DateTimeTest.php +++ b/core/modules/system/tests/src/Functional/System/DateTimeTest.php @@ -98,7 +98,7 @@ class DateTimeTest extends BrowserTestBase { $this->drupalGet('admin/config/regional/date-time'); // Add custom date format. - $this->clickLink(t('Add format')); + $this->clickLink('Add format'); $date_format_id = strtolower($this->randomMachineName(8)); $name = ucwords($date_format_id); $date_format = 'd.m.Y - H:i'; @@ -120,7 +120,7 @@ class DateTimeTest extends BrowserTestBase { // Edit the custom date format and re-save without editing the format. $this->drupalGet('admin/config/regional/date-time'); - $this->clickLink(t('Edit')); + $this->clickLink('Edit'); $this->submitForm([], 'Save format'); // Verify that the user is redirected to the correct page. $this->assertSession()->addressEquals(Url::fromRoute('entity.date_format.collection')); @@ -128,7 +128,7 @@ class DateTimeTest extends BrowserTestBase { // Edit custom date format. $this->drupalGet('admin/config/regional/date-time'); - $this->clickLink(t('Edit')); + $this->clickLink('Edit'); $edit = [ 'date_format_pattern' => 'Y m', ]; @@ -139,7 +139,7 @@ class DateTimeTest extends BrowserTestBase { $this->assertSession()->pageTextContains('Custom date format updated.'); // Delete custom date format. - $this->clickLink(t('Delete')); + $this->clickLink('Delete'); $this->drupalGet('admin/config/regional/date-time/formats/manage/' . $date_format_id . '/delete'); $this->submitForm([], 'Delete'); // Verify that the user is redirected to the correct page. diff --git a/core/modules/system/tests/src/Functional/System/ThemeTest.php b/core/modules/system/tests/src/Functional/System/ThemeTest.php index b5173cbe26e4..f42f62860b9f 100644 --- a/core/modules/system/tests/src/Functional/System/ThemeTest.php +++ b/core/modules/system/tests/src/Functional/System/ThemeTest.php @@ -365,7 +365,7 @@ class ThemeTest extends BrowserTestBase { // Install Bartik and set it as the default theme. $theme_installer->install(['bartik']); $this->drupalGet('admin/appearance'); - $this->clickLink(t('Set as default')); + $this->clickLink('Set as default'); $this->assertEquals('bartik', $this->config('system.theme')->get('default')); // Test the default theme on the secondary links (blocks admin page). @@ -374,7 +374,7 @@ class ThemeTest extends BrowserTestBase { // Switch back to Stark and test again to test that the menu cache is cleared. $this->drupalGet('admin/appearance'); // Stark is the first 'Set as default' link. - $this->clickLink(t('Set as default')); + $this->clickLink('Set as default'); $this->drupalGet('admin/structure/block'); $this->assertSession()->pageTextContains('Stark(active tab)'); } @@ -417,7 +417,7 @@ class ThemeTest extends BrowserTestBase { $this->drupalGet('admin/appearance'); $this->submitForm($edit, 'Save configuration'); $this->drupalGet('admin/appearance'); - $this->clickLink(t('Set as default')); + $this->clickLink('Set as default'); // Check that seven cannot be uninstalled as it is the admin theme. $this->assertNoRaw('Uninstall Seven theme'); @@ -444,7 +444,7 @@ class ThemeTest extends BrowserTestBase { $this->assertNoRaw('Uninstall Classy theme'); // Change the default theme to stark, stark is second in the list. - $this->clickLink(t('Set as default'), 1); + $this->clickLink('Set as default', 1); // Check that bartik can be uninstalled now. $this->assertRaw('Uninstall Bartik theme'); @@ -454,10 +454,10 @@ class ThemeTest extends BrowserTestBase { $this->assertNoRaw('Uninstall Classy theme'); // Uninstall each of the three themes starting with Bartik. - $this->clickLink(t('Uninstall')); + $this->clickLink('Uninstall'); $this->assertRaw('The Bartik theme has been uninstalled'); // Seven is the second in the list. - $this->clickLink(t('Uninstall')); + $this->clickLink('Uninstall'); $this->assertRaw('The Seven theme has been uninstalled'); // Check that the classy theme still can't be uninstalled as it is hidden. diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/InvalidUpdateHookTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/InvalidUpdateHookTest.php index e9964b9397c9..2400d469780f 100644 --- a/core/modules/system/tests/src/Functional/UpdateSystem/InvalidUpdateHookTest.php +++ b/core/modules/system/tests/src/Functional/UpdateSystem/InvalidUpdateHookTest.php @@ -60,7 +60,7 @@ class InvalidUpdateHookTest extends BrowserTestBase { $this->drupalLogin($this->updateUser); $this->drupalGet($this->updateUrl); $this->updateRequirementsProblem(); - $this->clickLink(t('Continue')); + $this->clickLink('Continue'); $this->assertSession()->pageTextContains('Some of the pending updates cannot be applied because their dependencies were not met.'); } diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/UpdateCacheTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/UpdateCacheTest.php index 424399598768..6bdbbb091783 100644 --- a/core/modules/system/tests/src/Functional/UpdateSystem/UpdateCacheTest.php +++ b/core/modules/system/tests/src/Functional/UpdateSystem/UpdateCacheTest.php @@ -41,7 +41,7 @@ class UpdateCacheTest extends BrowserTestBase { // Clicking continue should clear the caches. $this->drupalGet(Url::fromRoute('system.db_update', [], ['path_processing' => FALSE])); $this->updateRequirementsProblem(); - $this->clickLink(t('Continue')); + $this->clickLink('Continue'); $this->assertFalse(\Drupal::cache()->get('will_not_exist_after_update', FALSE)); } diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/UpdateSchemaTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/UpdateSchemaTest.php index 08f60f71964c..4402d5cc5f4a 100644 --- a/core/modules/system/tests/src/Functional/UpdateSystem/UpdateSchemaTest.php +++ b/core/modules/system/tests/src/Functional/UpdateSystem/UpdateSchemaTest.php @@ -68,10 +68,10 @@ class UpdateSchemaTest extends BrowserTestBase { $this->drupalLogin($this->user); $this->drupalGet($this->updateUrl, ['external' => TRUE]); $this->updateRequirementsProblem(); - $this->clickLink(t('Continue')); + $this->clickLink('Continue'); $this->assertRaw('Schema version 8001.'); // Run the update hooks. - $this->clickLink(t('Apply pending updates')); + $this->clickLink('Apply pending updates'); $this->checkForMetaRefresh(); // Ensure schema has changed. diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php index 401c01e8f73b..7ac648ce619e 100644 --- a/core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php +++ b/core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php @@ -129,7 +129,7 @@ class UpdateScriptTest extends BrowserTestBase { // go through the update process uninterrupted. $this->drupalGet($this->updateUrl, ['external' => TRUE]); $this->updateRequirementsProblem(); - $this->clickLink(t('Continue')); + $this->clickLink('Continue'); $this->assertSession()->pageTextContains('No pending updates.'); // Confirm that all caches were cleared. $this->assertSession()->pageTextContains('hook_cache_flush() invoked for update_script_test.module.'); @@ -147,8 +147,8 @@ class UpdateScriptTest extends BrowserTestBase { $this->assertSession()->pageTextContains('This is a requirements warning provided by the update_script_test module.'); $this->clickLink('try again'); $this->assertNoText('This is a requirements warning provided by the update_script_test module.'); - $this->clickLink(t('Continue')); - $this->clickLink(t('Apply pending updates')); + $this->clickLink('Continue'); + $this->clickLink('Apply pending updates'); $this->checkForMetaRefresh(); $this->assertSession()->pageTextContains('The update_script_test_update_8001() update was executed successfully.'); // Confirm that all caches were cleared. @@ -159,7 +159,7 @@ class UpdateScriptTest extends BrowserTestBase { $this->assertSession()->pageTextContains('This is a requirements warning provided by the update_script_test module.'); $this->clickLink('try again'); $this->assertNoText('This is a requirements warning provided by the update_script_test module.'); - $this->clickLink(t('Continue')); + $this->clickLink('Continue'); $this->assertSession()->pageTextContains('No pending updates.'); // Confirm that all caches were cleared. $this->assertSession()->pageTextContains('hook_cache_flush() invoked for update_script_test.module.'); @@ -416,7 +416,7 @@ class UpdateScriptTest extends BrowserTestBase { // updates' page without errors. $this->drupalGet($this->updateUrl, ['external' => TRUE]); $this->updateRequirementsProblem(); - $this->clickLink(t('Continue')); + $this->clickLink('Continue'); // Make sure there are no pending updates (or uncaught exceptions). $this->assertSession()->elementTextContains('xpath', '//div[@aria-label="Status message"]', 'No pending updates.'); // Verify that we warn the admin about this situation. @@ -428,7 +428,7 @@ class UpdateScriptTest extends BrowserTestBase { \Drupal::keyValue('system.schema')->set('update_test_0', 8000); $this->drupalGet($this->updateUrl, ['external' => TRUE]); $this->updateRequirementsProblem(); - $this->clickLink(t('Continue')); + $this->clickLink('Continue'); // There should not be any pending updates. $this->assertSession()->elementTextContains('xpath', '//div[@aria-label="Status message"]', 'No pending updates.'); // But verify that we warn the admin about this situation. @@ -438,7 +438,7 @@ class UpdateScriptTest extends BrowserTestBase { \Drupal::keyValue('system.schema')->set('my_already_removed_module', 8000); $this->drupalGet($this->updateUrl, ['external' => TRUE]); $this->updateRequirementsProblem(); - $this->clickLink(t('Continue')); + $this->clickLink('Continue'); // There still should not be any pending updates. $this->assertSession()->elementTextContains('xpath', '//div[@aria-label="Status message"]', 'No pending updates.'); // Verify that we warn the admin about both orphaned entries. @@ -504,7 +504,7 @@ class UpdateScriptTest extends BrowserTestBase { $this->drupalLogin($this->updateUser); $this->drupalGet($this->updateUrl, ['external' => TRUE]); $this->updateRequirementsProblem(); - $this->clickLink(t('Continue')); + $this->clickLink('Continue'); $this->assertSession()->pageTextContains('No pending updates.'); $this->assertSession()->linkNotExists('Administration pages'); $this->assertEmpty($this->xpath('//main//a[contains(@href, :href)]', [':href' => 'update.php'])); @@ -519,7 +519,7 @@ class UpdateScriptTest extends BrowserTestBase { $this->drupalLogin($admin_user); $this->drupalGet($this->updateUrl, ['external' => TRUE]); $this->updateRequirementsProblem(); - $this->clickLink(t('Continue')); + $this->clickLink('Continue'); $this->assertSession()->pageTextContains('No pending updates.'); $this->assertSession()->linkExists('Administration pages'); $this->assertEmpty($this->xpath('//main//a[contains(@href, :href)]', [':href' => 'update.php'])); @@ -557,8 +557,8 @@ class UpdateScriptTest extends BrowserTestBase { $this->drupalLogin($admin_user); $this->drupalGet($this->updateUrl, ['external' => TRUE]); $this->updateRequirementsProblem(); - $this->clickLink(t('Continue')); - $this->clickLink(t('Apply pending updates')); + $this->clickLink('Continue'); + $this->clickLink('Apply pending updates'); $this->checkForMetaRefresh(); $this->assertSession()->pageTextContains('Updates were attempted.'); $this->assertSession()->linkExists('logged'); @@ -631,8 +631,8 @@ class UpdateScriptTest extends BrowserTestBase { // 'access site reports' permissions. $this->drupalGet($this->updateUrl, ['external' => TRUE]); $this->updateRequirementsProblem(); - $this->clickLink(t('Continue')); - $this->clickLink(t('Apply pending updates')); + $this->clickLink('Continue'); + $this->clickLink('Apply pending updates'); $this->checkForMetaRefresh(); $this->assertSession()->pageTextContains('Updates were attempted.'); $this->assertSession()->linkExists('logged'); @@ -690,8 +690,8 @@ class UpdateScriptTest extends BrowserTestBase { } $this->drupalGet($this->updateUrl, ['external' => TRUE]); $this->updateRequirementsProblem(); - $this->clickLink(t('Continue')); - $this->clickLink(t('Apply pending updates')); + $this->clickLink('Continue'); + $this->clickLink('Apply pending updates'); $this->checkForMetaRefresh(); // Verify that updates were completed successfully. @@ -819,7 +819,7 @@ class UpdateScriptTest extends BrowserTestBase { $this->drupalGet($this->updateUrl, ['external' => TRUE]); $this->assertSession()->pageTextNotContains($unexpected_error_text); $this->updateRequirementsProblem(); - $this->clickLink(t('Continue')); + $this->clickLink('Continue'); $assert_session->pageTextContains('No pending updates.'); $this->assertInstalledExtensionConfig($extension_type, $extension_machine_name); } diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatesWith7xTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatesWith7xTest.php index 513bbfb7cbcb..57d2d67efb1d 100644 --- a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatesWith7xTest.php +++ b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatesWith7xTest.php @@ -61,7 +61,7 @@ class UpdatesWith7xTest extends BrowserTestBase { $this->drupalLogin($this->updateUser); $this->drupalGet($this->updateUrl, ['external' => TRUE]); $this->updateRequirementsProblem(); - $this->clickLink(t('Continue')); + $this->clickLink('Continue'); $this->assertSession()->pageTextContains('Some of the pending updates cannot be applied because their dependencies were not met.'); } diff --git a/core/modules/taxonomy/tests/src/Functional/TermTest.php b/core/modules/taxonomy/tests/src/Functional/TermTest.php index 8612682157d0..89d8ab80863a 100644 --- a/core/modules/taxonomy/tests/src/Functional/TermTest.php +++ b/core/modules/taxonomy/tests/src/Functional/TermTest.php @@ -209,7 +209,7 @@ class TermTest extends TaxonomyTestBase { $this->drupalGet('node/' . $node->id()); $this->assertSession()->pageTextContains($term1->getName()); - $this->clickLink(t('Edit')); + $this->clickLink('Edit'); $this->assertSession()->pageTextContains($term1->getName()); $this->submitForm([], 'Save'); $this->assertSession()->pageTextContains($term1->getName()); @@ -311,7 +311,7 @@ class TermTest extends TaxonomyTestBase { // Delete term 1 from the term edit page. $this->drupalGet('taxonomy/term/' . $term_objects['term1']->id() . '/edit'); - $this->clickLink(t('Delete')); + $this->clickLink('Delete'); $this->submitForm([], 'Delete'); // Delete term 2 from the term delete page. @@ -353,7 +353,7 @@ class TermTest extends TaxonomyTestBase { // Submitting a term takes us to the add page; we need the List page. $this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/overview'); - $this->clickLink(t('Edit')); + $this->clickLink('Edit'); // Verify that the randomly generated term is present. $this->assertRaw($edit['name[0][value]']); @@ -401,7 +401,7 @@ class TermTest extends TaxonomyTestBase { // Delete the term. $this->drupalGet('taxonomy/term/' . $term->id() . '/edit'); - $this->clickLink(t('Delete')); + $this->clickLink('Delete'); $this->submitForm([], 'Delete'); // Assert that the term no longer exists. @@ -591,7 +591,7 @@ class TermTest extends TaxonomyTestBase { // Check that the term is displayed when editing and saving the node with no // changes. - $this->clickLink(t('Edit')); + $this->clickLink('Edit'); $this->assertRaw($term->getName()); $this->submitForm([], 'Save'); $this->assertRaw($term->getName()); diff --git a/core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php b/core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php index 071b825f33e4..9a75d84f3c48 100644 --- a/core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php +++ b/core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php @@ -40,7 +40,7 @@ class VocabularyUiTest extends TaxonomyTestBase { $this->drupalGet('admin/structure/taxonomy'); // Create a new vocabulary. - $this->clickLink(t('Add vocabulary')); + $this->clickLink('Add vocabulary'); $edit = []; $vid = mb_strtolower($this->randomMachineName()); $edit['name'] = $this->randomMachineName(); @@ -54,7 +54,7 @@ class VocabularyUiTest extends TaxonomyTestBase { $this->assertSession()->pageTextContains($edit['name']); $this->assertSession()->pageTextContains($edit['description']); $this->assertSession()->linkByHrefExists(Url::fromRoute('entity.taxonomy_term.add_form', ['taxonomy_vocabulary' => $edit['vid']])->toString()); - $this->clickLink(t('Edit vocabulary')); + $this->clickLink('Edit vocabulary'); $edit = []; $edit['name'] = $this->randomMachineName(); $edit['description'] = $this->randomMachineName(); @@ -154,7 +154,7 @@ class VocabularyUiTest extends TaxonomyTestBase { // Delete the vocabulary. $this->drupalGet('admin/structure/taxonomy/manage/' . $vocabulary->id()); - $this->clickLink(t('Delete')); + $this->clickLink('Delete'); $this->assertRaw(t('Are you sure you want to delete the vocabulary %name?', ['%name' => $vocabulary->label()])); $this->assertSession()->pageTextContains('Deleting a vocabulary will delete all the terms in it. This action cannot be undone.'); diff --git a/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php b/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php index d0708ffca8c3..c6018660148a 100644 --- a/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php +++ b/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php @@ -332,7 +332,7 @@ class UpdateSemverCoreTest extends UpdateSemverTestBase { ->save(); $this->drupalGet('admin/reports/updates'); - $this->clickLink(t('Check manually')); + $this->clickLink('Check manually'); $this->checkForMetaRefresh(); $this->assertSession()->pageTextContains('Checked available update data for one project.'); $this->drupalGet('admin/modules'); @@ -354,7 +354,7 @@ class UpdateSemverCoreTest extends UpdateSemverTestBase { ->save(); $this->drupalGet('admin/reports/updates'); - $this->clickLink(t('Check manually')); + $this->clickLink('Check manually'); $this->checkForMetaRefresh(); $this->assertSession()->pageTextContains('Checked available update data for one project.'); $this->drupalGet('admin/modules'); @@ -376,7 +376,7 @@ class UpdateSemverCoreTest extends UpdateSemverTestBase { ->save(); $this->drupalGet('admin/reports/updates'); - $this->clickLink(t('Check manually')); + $this->clickLink('Check manually'); $this->checkForMetaRefresh(); $this->assertSession()->pageTextContains('Checked available update data for one project.'); $this->drupalGet('admin/modules'); @@ -465,15 +465,15 @@ class UpdateSemverCoreTest extends UpdateSemverTestBase { $this->drupalLogin($admin_user); $this->drupalGet('admin/modules'); - $this->clickLink(t('Add new module')); + $this->clickLink('Add new module'); $this->assertSession()->addressEquals('admin/modules/install'); $this->drupalGet('admin/appearance'); - $this->clickLink(t('Add new theme')); + $this->clickLink('Add new theme'); $this->assertSession()->addressEquals('admin/theme/install'); $this->drupalGet('admin/reports/updates'); - $this->clickLink(t('Add new module or theme')); + $this->clickLink('Add new module or theme'); $this->assertSession()->addressEquals('admin/reports/updates/install'); } diff --git a/core/modules/update/tests/src/Functional/UpdateTestBase.php b/core/modules/update/tests/src/Functional/UpdateTestBase.php index a1fde0dcad99..a7dea2a70191 100644 --- a/core/modules/update/tests/src/Functional/UpdateTestBase.php +++ b/core/modules/update/tests/src/Functional/UpdateTestBase.php @@ -98,7 +98,7 @@ abstract class UpdateTestBase extends BrowserTestBase { $this->config('update_test.settings')->set('xml_map', $xml_map)->save(); // Manually check the update status. $this->drupalGet('admin/reports/updates'); - $this->clickLink(t('Check manually')); + $this->clickLink('Check manually'); $this->checkForMetaRefresh(); } @@ -219,7 +219,7 @@ abstract class UpdateTestBase extends BrowserTestBase { */ protected function confirmRevokedStatus($revoked_version, $newer_version, $new_version_label) { $this->drupalGet('admin/reports/updates'); - $this->clickLink(t('Check manually')); + $this->clickLink('Check manually'); $this->checkForMetaRefresh(); $this->assertUpdateTableTextContains('Revoked!'); $this->assertUpdateTableTextContains($revoked_version); @@ -241,7 +241,7 @@ abstract class UpdateTestBase extends BrowserTestBase { */ protected function confirmUnsupportedStatus($unsupported_version, $newer_version, $new_version_label) { $this->drupalGet('admin/reports/updates'); - $this->clickLink(t('Check manually')); + $this->clickLink('Check manually'); $this->checkForMetaRefresh(); $this->assertUpdateTableTextContains('Not supported!'); $this->assertUpdateTableTextContains($unsupported_version); diff --git a/core/modules/update/tests/src/Functional/UpdateUploadTest.php b/core/modules/update/tests/src/Functional/UpdateUploadTest.php index 268598a1ad0d..f59e9c38ad83 100644 --- a/core/modules/update/tests/src/Functional/UpdateUploadTest.php +++ b/core/modules/update/tests/src/Functional/UpdateUploadTest.php @@ -102,7 +102,7 @@ class UpdateUploadTest extends UpdateTestBase { $this->assertSession()->linkExists('Administration pages'); $this->assertSession()->linkByHrefExists(Url::fromRoute('system.admin')->toString()); // Ensure we can reach the "Add another module" link. - $this->clickLink(t('Add another module')); + $this->clickLink('Add another module'); $this->assertSession()->statusCodeEquals(200); $this->assertSession()->addressEquals('admin/modules/install'); diff --git a/core/modules/user/tests/src/Functional/UserRoleAdminTest.php b/core/modules/user/tests/src/Functional/UserRoleAdminTest.php index 2bbc64309237..1cb1900cb2a4 100644 --- a/core/modules/user/tests/src/Functional/UserRoleAdminTest.php +++ b/core/modules/user/tests/src/Functional/UserRoleAdminTest.php @@ -89,7 +89,7 @@ class UserRoleAdminTest extends BrowserTestBase { // Test deleting a role. $this->drupalGet("admin/people/roles/manage/{$role->id()}"); - $this->clickLink(t('Delete')); + $this->clickLink('Delete'); $this->submitForm([], 'Delete'); $this->assertRaw(t('The role %label has been deleted.', ['%label' => $role_name])); $this->assertSession()->linkByHrefNotExists("admin/people/roles/manage/{$role->id()}", 'Role edit link removed.'); diff --git a/core/modules/views/tests/src/Functional/Handler/FieldWebTest.php b/core/modules/views/tests/src/Functional/Handler/FieldWebTest.php index 91b9f81882a5..240ec8f5faa6 100644 --- a/core/modules/views/tests/src/Functional/Handler/FieldWebTest.php +++ b/core/modules/views/tests/src/Functional/Handler/FieldWebTest.php @@ -84,7 +84,7 @@ class FieldWebTest extends ViewTestBase { $this->assertCacheContexts($expected_contexts); // Clicking a click sort should change the order. - $this->clickLink(t('ID')); + $this->clickLink('ID'); $href = Url::fromRoute('', [], ['query' => ['order' => 'id', 'sort' => 'desc']])->toString(); $this->assertSession()->linkByHrefExists($href); // Check that the output has the expected order (asc). @@ -94,7 +94,7 @@ class FieldWebTest extends ViewTestBase { $result = $this->xpath('//a[@href="' . $href . '"]'); $this->assertEquals('nofollow', $result[0]->getAttribute('rel')); - $this->clickLink(t('ID Sort descending')); + $this->clickLink('ID Sort descending'); // Check that the output has the expected order (desc). $ids = $this->clickSortLoadIdsFromOutput(); $this->assertEquals(range(5, 1, -1), $ids); diff --git a/core/modules/views_ui/tests/src/Functional/AnalyzeTest.php b/core/modules/views_ui/tests/src/Functional/AnalyzeTest.php index e37bf293af61..8d4580bf960a 100644 --- a/core/modules/views_ui/tests/src/Functional/AnalyzeTest.php +++ b/core/modules/views_ui/tests/src/Functional/AnalyzeTest.php @@ -38,7 +38,7 @@ class AnalyzeTest extends UITestBase { $this->assertSession()->linkExists('Analyze view'); // This redirects the user to the analyze form. - $this->clickLink(t('Analyze view')); + $this->clickLink('Analyze view'); $this->assertSession()->titleEquals('View analysis | Drupal'); foreach (['ok', 'warning', 'error'] as $type) { diff --git a/core/modules/views_ui/tests/src/Functional/CachedDataUITest.php b/core/modules/views_ui/tests/src/Functional/CachedDataUITest.php index f618921bc5b5..d97b5c532eb1 100644 --- a/core/modules/views_ui/tests/src/Functional/CachedDataUITest.php +++ b/core/modules/views_ui/tests/src/Functional/CachedDataUITest.php @@ -62,7 +62,7 @@ class CachedDataUITest extends UITestBase { // Test we have the break lock link. $this->assertSession()->linkByHrefExists('admin/structure/views/view/test_view/break-lock'); // Break the lock. - $this->clickLink(t('break this lock')); + $this->clickLink('break this lock'); $this->submitForm([], 'Break lock'); // Test that save and cancel buttons are shown. $this->assertSession()->buttonExists('Save'); diff --git a/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php b/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php index 3cae3de83c60..28ef8dc7210d 100644 --- a/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php +++ b/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php @@ -68,9 +68,7 @@ class DisplayPathTest extends UITestBase { $this->drupalGet('admin/structure/views/nojs/display/test_view/page_1/path'); $this->submitForm(['path' => $random_path], 'Apply'); $this->assertSession()->pageTextContains('/' . $random_path); - $display_link_text = t('View @display', ['@display' => 'Page']); - $this->assertSession()->linkExists($display_link_text, 0, 'view page link found on the page.'); - $this->clickLink($display_link_text); + $this->clickLink('View Page'); $this->assertSession()->addressEquals($random_path); } @@ -254,7 +252,7 @@ class DisplayPathTest extends UITestBase { $plugin_definition = end($result)->link->getPluginDefinition(); $this->assertEquals('view.' . $view_id . '.page_1', $plugin_definition['route_name']); - $this->clickLink(t('No menu')); + $this->clickLink('No menu'); $this->submitForm([ 'menu[type]' => 'default tab', diff --git a/core/modules/views_ui/tests/src/Functional/DisplayTest.php b/core/modules/views_ui/tests/src/Functional/DisplayTest.php index 07f02069d987..69f375b38ce9 100644 --- a/core/modules/views_ui/tests/src/Functional/DisplayTest.php +++ b/core/modules/views_ui/tests/src/Functional/DisplayTest.php @@ -53,7 +53,7 @@ class DisplayTest extends UITestBase { ]; $view = $this->randomView($view); - $this->clickLink(t('Reorder displays')); + $this->clickLink('Reorder displays'); $this->assertNotEmpty($this->xpath('//tr[@id="display-row-default"]'), 'Make sure the default display appears on the reorder listing'); $this->assertNotEmpty($this->xpath('//tr[@id="display-row-page_1"]'), 'Make sure the page display appears on the reorder listing'); $this->assertNotEmpty($this->xpath('//tr[@id="display-row-block_1"]'), 'Make sure the block display appears on the reorder listing'); @@ -187,7 +187,7 @@ class DisplayTest extends UITestBase { // Test the default link_url value for new display $this->submitForm([], 'Add Block'); $this->assertSession()->addressEquals('admin/structure/views/view/test_display/edit/block_2'); - $this->clickLink(t('Custom URL')); + $this->clickLink('Custom URL'); $this->assertSession()->fieldValueEquals('link_url', 'a-custom-url'); } diff --git a/core/modules/views_ui/tests/src/Functional/PreviewTest.php b/core/modules/views_ui/tests/src/Functional/PreviewTest.php index da33e1919973..08a93c8c3e6c 100644 --- a/core/modules/views_ui/tests/src/Functional/PreviewTest.php +++ b/core/modules/views_ui/tests/src/Functional/PreviewTest.php @@ -80,7 +80,7 @@ class PreviewTest extends UITestBase { $view['page[feed_properties][path]'] = $this->randomMachineName(16); $this->drupalGet('admin/structure/views/add'); $this->submitForm($view, 'Save and edit'); - $this->clickLink(t('Feed')); + $this->clickLink('Feed'); $this->submitForm([], 'Update preview'); $this->assertSession()->elementTextContains('xpath', '//div[@id="views-live-preview"]/pre', '' . $view['page[title]'] . ''); diff --git a/core/modules/views_ui/tests/src/Functional/ViewEditTest.php b/core/modules/views_ui/tests/src/Functional/ViewEditTest.php index c4357db52d11..1ee8da342edc 100644 --- a/core/modules/views_ui/tests/src/Functional/ViewEditTest.php +++ b/core/modules/views_ui/tests/src/Functional/ViewEditTest.php @@ -33,7 +33,7 @@ class ViewEditTest extends UITestBase { $view = $this->container->get('entity_type.manager')->getStorage('view')->load('test_view'); $this->assertInstanceOf(View::class, $view); - $this->clickLink(t('Delete view')); + $this->clickLink('Delete view'); $this->assertSession()->addressEquals('admin/structure/views/view/test_view/delete'); $this->submitForm([], 'Delete'); $this->assertRaw(t('The view %name has been deleted.', ['%name' => $view->label()])); diff --git a/core/profiles/standard/tests/src/Functional/StandardTest.php b/core/profiles/standard/tests/src/Functional/StandardTest.php index 0f071645b597..1bf5f725d1f9 100644 --- a/core/profiles/standard/tests/src/Functional/StandardTest.php +++ b/core/profiles/standard/tests/src/Functional/StandardTest.php @@ -39,7 +39,7 @@ class StandardTest extends BrowserTestBase { public function testStandard() { $this->drupalGet(''); $this->assertSession()->linkExists('Contact'); - $this->clickLink(t('Contact')); + $this->clickLink('Contact'); $this->assertSession()->statusCodeEquals(200); // Test anonymous user can access 'Main navigation' block. diff --git a/core/tests/Drupal/FunctionalTests/Routing/RouteCachingLanguageTest.php b/core/tests/Drupal/FunctionalTests/Routing/RouteCachingLanguageTest.php index 24d08d7733cf..9f9d4885c0db 100644 --- a/core/tests/Drupal/FunctionalTests/Routing/RouteCachingLanguageTest.php +++ b/core/tests/Drupal/FunctionalTests/Routing/RouteCachingLanguageTest.php @@ -172,7 +172,7 @@ class RouteCachingLanguageTest extends BrowserTestBase { $this->drupalGet('link-page', $source_url_options); $this->clickLink('Translate'); - $this->clickLink(t('Add')); + $this->clickLink('Add'); // Do not change the link field. $edit = [ diff --git a/core/tests/Drupal/Tests/UpdatePathTestTrait.php b/core/tests/Drupal/Tests/UpdatePathTestTrait.php index d3824943f622..f1b32f7f9c32 100644 --- a/core/tests/Drupal/Tests/UpdatePathTestTrait.php +++ b/core/tests/Drupal/Tests/UpdatePathTestTrait.php @@ -44,11 +44,11 @@ trait UpdatePathTestTrait { $this->drupalGet($update_url); $this->updateRequirementsProblem(); - $this->clickLink(t('Continue')); + $this->clickLink('Continue'); $this->doSelectionTest(); // Run the update hooks. - $this->clickLink(t('Apply pending updates')); + $this->clickLink('Apply pending updates'); $this->checkForMetaRefresh(); // Ensure there are no failed updates.