Commit 4a7c2054 authored by catch's avatar catch
Browse files

Issue #3153143 by ridhimaabrol24, Hardik_Patel_12, siddhant.bhosale,...

Issue #3153143 by ridhimaabrol24, Hardik_Patel_12, siddhant.bhosale, guptahemant, quietone, paulocs: Remove uses of t() in linkExists() and linkNotExists() calls
parent c7558c41
......@@ -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';
......
......@@ -34,7 +34,7 @@ public function testCommentLinksAlter() {
$this->drupalGet('node/' . $this->node->id());
$this->assertSession()->linkExists(t('Report'));
$this->assertSession()->linkExists('Report');
}
}
......@@ -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');
}
......
......@@ -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
......
......@@ -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');
}
}
......
......@@ -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.
......
......@@ -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'));
......
......@@ -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.
......
......@@ -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"
......
......@@ -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;
......
......@@ -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[]');
......
......@@ -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');
......
......@@ -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());
......
......@@ -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');
}
/**
......
......@@ -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');
}
......
......@@ -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');
}
}
......@@ -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']);
......
......@@ -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]]);
......
......@@ -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);
......
......@@ -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]']);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment