Unverified Commit 8130d889 authored by alexpott's avatar alexpott

Issue #3139414 by cburschka, mohrerao, pavnish, jungle, ravi.shankar, daffie,...

Issue #3139414 by cburschka, mohrerao, pavnish, jungle, ravi.shankar, daffie, mondrake, sja112: Replace usages of deprecated AssertLegacyTrait::assert(No)Link()
parent fd046df3
......@@ -76,7 +76,7 @@ public function testBasicAuth() {
// Ensure that a route without basic auth defined doesn't allow login.
$this->basicAuthGet(Url::fromRoute('system.admin'), $account->getAccountName(), $account->pass_raw);
$this->assertNoLink('Log out', 'User is not logged in');
$this->assertSession()->linkNotExists('Log out', 'User is not logged in');
$this->assertSession()->statusCodeEquals(403);
$this->mink->resetSessions();
......
......@@ -152,9 +152,9 @@ public function testBlockAdminUiPage() {
\Drupal::service('theme_installer')->install(['stable', 'stark']);
$this->drupalGet('admin/structure/block');
$theme_handler = \Drupal::service('theme_handler');
$this->assertLink($theme_handler->getName('classy'));
$this->assertLink($theme_handler->getName('stark'));
$this->assertNoLink($theme_handler->getName('stable'));
$this->assertSession()->linkExists($theme_handler->getName('classy'));
$this->assertSession()->linkExists($theme_handler->getName('stark'));
$this->assertSession()->linkNotExists($theme_handler->getName('stable'));
// Ensure that a hidden theme cannot use the block demo page.
$this->drupalGet('admin/structure/block/list/stable');
......@@ -166,7 +166,7 @@ public function testBlockAdminUiPage() {
\Drupal::service('router.builder')->rebuildIfNeeded();
$this->drupalPlaceBlock('local_tasks_block', ['region' => 'header', 'theme' => 'stable']);
$this->drupalGet('admin/structure/block');
$this->assertLink($theme_handler->getName('stable'));
$this->assertSession()->linkExists($theme_handler->getName('stable'));
$this->drupalGet('admin/structure/block/list/stable');
$this->assertSession()->statusCodeEquals(200);
}
......
......@@ -55,7 +55,7 @@ public function testListing() {
$new_label = 'Albatross';
// Add a new entity using the operations link.
$link_text = t('Add custom block');
$this->assertLink($link_text);
$this->assertSession()->linkExists($link_text);
$this->clickLink($link_text);
$this->assertSession()->statusCodeEquals(200);
$edit = [];
......
......@@ -67,7 +67,7 @@ public function testListing() {
$new_label = 'Albatross';
// Add a new entity using the operations link.
$link_text = t('Add custom block');
$this->assertLink($link_text);
$this->assertSession()->linkExists($link_text);
$this->clickLink($link_text);
$this->assertSession()->statusCodeEquals(200);
$edit = [];
......@@ -123,7 +123,7 @@ public function testListing() {
// Confirm that the empty text is displayed.
$this->assertText('There are no custom blocks available.');
$this->assertLink('custom block');
$this->assertSession()->linkExists('custom block');
$block_content = BlockContent::create([
'info' => 'Non-reusable block',
......
......@@ -220,7 +220,7 @@ public function testBookExport() {
// Load the book and verify there is no printer-friendly version link.
$this->drupalGet('node/' . $this->book->id());
$this->assertNoLink(t('Printer-friendly version'), 'Anonymous user is not shown link to printer-friendly version.');
$this->assertSession()->linkNotExists(t('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());
......@@ -402,13 +402,13 @@ public function testBookOutline() {
// Create new node not yet a book.
$empty_book = $this->drupalCreateNode(['type' => 'book']);
$this->drupalGet('node/' . $empty_book->id() . '/outline');
$this->assertNoLink(t('Book outline'), 'Book Author is not allowed to outline');
$this->assertSession()->linkNotExists(t('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'));
$this->assertOptionSelected('edit-book-bid', 0, 'Node does not belong to a book');
$this->assertNoLink(t('Remove from book outline'));
$this->assertSession()->linkNotExists(t('Remove from book outline'));
$edit = [];
$edit['book[bid]'] = '1';
......
......@@ -153,7 +153,7 @@ public function testRelationship() {
$this->drupalGet('test-book/' . $nodes[$i]->id());
for ($j = 0; $j < $i; $j++) {
$this->assertLink($nodes[$j]->label());
$this->assertSession()->linkExists($nodes[$j]->label());
}
}
}
......
......@@ -176,7 +176,7 @@ public function testAnonymous() {
// "Login or register to post comments" type link may be shown.
$this->drupalGet('node/' . $this->node->id());
$this->assertSession()->responseNotMatches('@<h2[^>]*>Comments</h2>@', 'Comments were not displayed.');
$this->assertNoLink('Add new comment', 'Link to add comment was found.');
$this->assertSession()->linkNotExists('Add new comment', 'Link to add comment was found.');
// Attempt to view node-comment form while disallowed.
$this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment');
......@@ -189,8 +189,8 @@ public function testAnonymous() {
]);
$this->drupalGet('node/' . $this->node->id());
$this->assertPattern('@<h2[^>]*>Comments</h2>@', 'Comments were displayed.');
$this->assertLink('Log in', 1, 'Link to login was found.');
$this->assertLink('register', 1, 'Link to register was found.');
$this->assertSession()->linkExists('Log in', 1, 'Link to login was found.');
$this->assertSession()->linkExists('register', 1, 'Link to register was found.');
user_role_change_permissions(RoleInterface::ANONYMOUS_ID, [
'access comments' => FALSE,
......
......@@ -34,7 +34,7 @@ public function testCommentLinksAlter() {
$this->drupalGet('node/' . $this->node->id());
$this->assertLink(t('Report'));
$this->assertSession()->linkExists(t('Report'));
}
}
......@@ -101,9 +101,9 @@ public function testCommentLinks() {
// In teaser view, a link containing the comment count is always
// expected.
if ($path == 'node') {
$this->assertLink(t('1 comment'));
$this->assertSession()->linkExists(t('1 comment'));
}
$this->assertLink('Add new comment');
$this->assertSession()->linkExists('Add new comment');
}
$display_repository = $this->container->get('entity_display.repository');
......@@ -133,13 +133,13 @@ public function testCommentLinks() {
->removeComponent('links')
->save();
$this->drupalGet($this->node->toUrl());
$this->assertNoLink('1 comment');
$this->assertNoLink('Add new comment');
$this->assertSession()->linkNotExists('1 comment');
$this->assertSession()->linkNotExists('Add new comment');
// Visit the full node, make sure there are links for the comment.
$this->drupalGet('node/' . $this->node->id());
$this->assertText($comment->getSubject());
$this->assertLink('Reply');
$this->assertSession()->linkExists('Reply');
// Make sure we can hide comment links.
$display_repository->getViewDisplay('comment', 'comment')
......@@ -147,7 +147,7 @@ public function testCommentLinks() {
->save();
$this->drupalGet('node/' . $this->node->id());
$this->assertText($comment->getSubject());
$this->assertNoLink('Reply');
$this->assertSession()->linkNotExists('Reply');
}
}
......@@ -60,8 +60,8 @@ public function testCommentNewCommentsIndicator() {
// node.
$this->drupalLogin($this->adminUser);
$this->drupalGet('node');
$this->assertNoLink(t('@count comments', ['@count' => 0]));
$this->assertLink(t('Read more'));
$this->assertSession()->linkNotExists(t('@count comments', ['@count' => 0]));
$this->assertSession()->linkExists(t('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
......
......@@ -355,7 +355,7 @@ public function testCommentFunctionality() {
// Attempt to view comments while disallowed.
$this->drupalGet('entity-test/' . $this->entity->id());
$this->assertSession()->responseNotMatches('@<h2[^>]*>Comments</h2>@', 'Comments were not displayed.');
$this->assertNoLink('Add new comment', 'Link to add comment was found.');
$this->assertSession()->linkNotExists('Add new comment', 'Link to add comment was found.');
// Attempt to view test entity comment form while disallowed.
$this->drupalGet('comment/reply/entity_test/' . $this->entity->id() . '/comment');
......@@ -371,8 +371,8 @@ public function testCommentFunctionality() {
]);
$this->drupalGet('entity_test/' . $this->entity->id());
$this->assertPattern('@<h2[^>]*>Comments</h2>@', 'Comments were displayed.');
$this->assertLink('Log in', 0, 'Link to login was found.');
$this->assertLink('register', 0, 'Link to register was found.');
$this->assertSession()->linkExists('Log in', 0, 'Link to login was found.');
$this->assertSession()->linkExists('register', 0, 'Link to register was found.');
$this->assertNoFieldByName('subject[0][value]', '', 'Subject field not found.');
$this->assertNoFieldByName('comment_body[0][value]', '', 'Comment field not found.');
......
......@@ -190,7 +190,7 @@ public function testListUI() {
$this->assertNotEmpty($elements[2]->find('xpath', '//ul'), 'Operations list found.');
// Add a new entity using the operations link.
$this->assertLink('Add test configuration');
$this->assertSession()->linkExists('Add test configuration');
$this->clickLink('Add test configuration');
$this->assertSession()->statusCodeEquals(200);
$edit = [
......
......@@ -126,7 +126,7 @@ public function testMapperListPage() {
$this->assertRaw('<th>' . t('Language') . '</th>');
$this->drupalGet($base_url);
$this->assertLink(t('Translate @title', ['@title' => $entity_type->getSingularLabel()]));
$this->assertSession()->linkExists(t('Translate @title', ['@title' => $entity_type->getSingularLabel()]));
}
}
......
......@@ -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->assertNoLink(t('Edit'));
$this->assertSession()->linkNotExists(t('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->assertLink(t('Translate @type', ['@type' => 'contact form']));
$this->assertSession()->linkExists(t('Translate @type', ['@type' => '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->assertLink(t('Translate @type', ['@type' => 'contact form']));
$this->assertSession()->linkExists(t('Translate @type', ['@type' => '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->assertNoLink(t('Edit'));
$this->assertSession()->linkNotExists(t('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->assertLink(t('Translate @type', ['@type' => 'account settings']));
$this->assertSession()->linkExists(t('Translate @type', ['@type' => 'account settings']));
$this->drupalGet('admin/config/people/accounts/translate');
$this->assertLink(t('Translate @type', ['@type' => 'account settings']));
$this->assertSession()->linkExists(t('Translate @type', ['@type' => 'account settings']));
$this->assertLinkByHref('admin/config/people/accounts/translate/fr/add');
// Update account settings fields for French.
......
......@@ -59,7 +59,7 @@ protected function setUp() {
public function testSettingsUI() {
// Check for the content_translation_menu_links_discovered_alter() changes.
$this->drupalGet('admin/config');
$this->assertLink('Content language and translation');
$this->assertSession()->linkExists('Content language and translation');
$this->assertText('Configure language and translation support for content.');
// Test that the translation settings are ignored if the bundle is marked
// translatable but the entity type is not.
......
......@@ -138,10 +138,10 @@ public function testWorkflows() {
foreach ($ops as $op => $label) {
if ($op != $current_op) {
$this->assertNoLink($label, new FormattableMarkup('No %op link found.', ['%op' => $label]));
$this->assertSession()->linkNotExists($label, new FormattableMarkup('No %op link found.', ['%op' => $label]));
}
else {
$this->assertLink($label, 0, new FormattableMarkup('%op link found.', ['%op' => $label]));
$this->assertSession()->linkExists($label, 0, new FormattableMarkup('%op link found.', ['%op' => $label]));
}
}
}
......
......@@ -228,7 +228,7 @@ public function testLogEventPageWithMissingInfo() {
// Verify location is available as plain text.
$this->assertEquals($request_uri, $this->cssSelect('table.dblog-event > tbody > tr:nth-child(4) > td')[0]->getHtml());
$this->assertNoLink($request_uri);
$this->assertSession()->linkNotExists($request_uri);
}
/**
......@@ -782,7 +782,7 @@ protected function getSeverityConstant($class) {
*/
protected function assertLogMessage($log_message, $message) {
$message_text = Unicode::truncate(Html::decodeEntities(strip_tags($log_message)), 56, TRUE, TRUE);
$this->assertLink($message_text, 0, $message);
$this->assertSession()->linkExists($message_text, 0, $message);
}
/**
......
......@@ -192,7 +192,7 @@ public function testFieldAdminHandler() {
'field_test_entity_ref_field[0][target_id]' => $node1->getTitle() . ' (' . $node1->id() . ')',
];
$this->drupalPostForm('node/add/' . $this->type, $edit, t('Save'));
$this->assertLink($node1->getTitle());
$this->assertSession()->linkExists($node1->getTitle());
// Tests adding default values to autocomplete widgets.
Vocabulary::create(['vid' => 'tags', 'name' => 'tags'])->save();
......
......@@ -55,10 +55,10 @@ public function testFieldHelp() {
\Drupal::service('plugin.manager.field.field_type')->clearCachedDefinitions();
$this->drupalGet('admin/help/field');
$this->assertLink('Options', 0, 'Options module is listed on the Field help page.');
$this->assertSession()->linkExists('Options', 0, 'Options module is listed on the Field help page.');
$this->assertText('Field API Test', 'Modules with field types that do not implement hook_help are listed.');
$this->assertNoLink('Field API Test', 'Modules with field types that do not implement hook_help are not linked.');
$this->assertNoLink('Link', 'Modules that have not been installed, are not listed.');
$this->assertSession()->linkNotExists('Field API Test', 'Modules with field types that do not implement hook_help are not linked.');
$this->assertSession()->linkNotExists('Link', 'Modules that have not been installed, are not listed.');
}
}
......@@ -60,7 +60,7 @@ public function testEntityViewModeUI() {
$this->assertSession()->statusCodeEquals(404);
$this->drupalGet('admin/structure/display-modes/view/add');
$this->assertNoLink(t('Test entity - revisions and data table'), 'An entity type with no view builder cannot have view modes.');
$this->assertSession()->linkNotExists(t('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->assertNoLink(t('Entity Test without label'), 'An entity type with no form cannot have form modes.');
$this->assertSession()->linkNotExists(t('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'));
......
......@@ -87,7 +87,7 @@ public function testFieldUIRoutes() {
$edit = ['display_modes_custom[test]' => TRUE];
$this->drupalPostForm('admin/config/people/accounts/display', $edit, t('Save'));
$this->assertLink('Test');
$this->assertSession()->linkExists('Test');
// Create new form mode and verify it's available on the Manage Form
// Display screen after enabling it.
......@@ -100,17 +100,17 @@ public function testFieldUIRoutes() {
$edit = ['display_modes_custom[test]' => TRUE];
$this->drupalPostForm('admin/config/people/accounts/form-display', $edit, t('Save'));
$this->assertLink('Test');
$this->assertSession()->linkExists('Test');
}
/**
* Asserts that local tasks exists.
*/
public function assertLocalTasks() {
$this->assertLink('Settings');
$this->assertLink('Manage fields');
$this->assertLink('Manage display');
$this->assertLink('Manage form display');
$this->assertSession()->linkExists('Settings');
$this->assertSession()->linkExists('Manage fields');
$this->assertSession()->linkExists('Manage display');
$this->assertSession()->linkExists('Manage form display');
}
/**
......
......@@ -149,12 +149,12 @@ public function testViewModeCustom() {
public function testViewModeLocalTasks() {
$manage_display = 'admin/structure/types/manage/' . $this->type . '/display';
$this->drupalGet($manage_display);
$this->assertNoLink('Full content');
$this->assertLink('Teaser');
$this->assertSession()->linkNotExists('Full content');
$this->assertSession()->linkExists('Teaser');
$this->drupalGet($manage_display . '/teaser');
$this->assertNoLink('Full content');
$this->assertLink('Default');
$this->assertSession()->linkNotExists('Full content');
$this->assertSession()->linkExists('Default');
}
/**
......
......@@ -158,7 +158,7 @@ public function manageFieldsPage($type = '') {
}
// Test the "Add field" action link.
$this->assertLink('Add field');
$this->assertSession()->linkExists('Add field');
// Assert entity operations for all fields.
$number_of_links = 3;
......@@ -278,9 +278,9 @@ public function cardinalitySettings() {
$this->assertFieldByXPath("//input[@name='cardinality_number']", 6);
// Check that tabs displayed.
$this->assertLink(t('Edit'));
$this->assertSession()->linkExists(t('Edit'));
$this->assertLinkByHref('admin/structure/types/manage/article/fields/node.article.body');
$this->assertLink(t('Field settings'));
$this->assertSession()->linkExists(t('Field settings'));
$this->assertLinkByHref($field_edit_path);
// Add two entries in the body.
......
......@@ -47,7 +47,7 @@ public function fieldUIAddNewField($bundle_path, $field_name, $label = NULL, $fi
$this->drupalPostForm($bundle_path, $initial_edit, t('Save and continue'));
$this->assertRaw(t('These settings apply to the %label field everywhere it is used.', ['%label' => $label]), 'Storage settings page was displayed.');
// Test Breadcrumbs.
$this->assertLink($label, 0, 'Field label is correct in the breadcrumb of the storage settings page.');
$this->assertSession()->linkExists($label, 0, 'Field label is correct in the breadcrumb of the storage settings page.');
// Second step: 'Storage settings' form.
$this->drupalPostForm(NULL, $storage_edit, t('Save field settings'));
......@@ -115,7 +115,7 @@ public function fieldUIDeleteField($bundle_path, $field_name, $label, $bundle_la
$this->assertRaw(t('Are you sure you want to delete the field %label', ['%label' => $label]), 'Delete confirmation was found.');
// Test Breadcrumbs.
$this->assertLink($label, 0, 'Field label is correct in the breadcrumb of the field delete page.');
$this->assertSession()->linkExists($label, 0, 'Field label is correct in the breadcrumb of the field delete page.');
// Submit confirmation form.
$this->drupalPostForm(NULL, [], t('Delete'));
......
......@@ -202,8 +202,8 @@ public function testFileListingUsageNoLink() {
// Entity name should be displayed, but not linked if Entity::toUrl
// throws an exception
$this->assertText($entity_name, 'Entity name is added to file usage listing.');
$this->assertNoLink($entity_name, 'Linked entity name not added to file usage listing.');
$this->assertLink($node->getTitle());
$this->assertSession()->linkNotExists($entity_name, 'Linked entity name not added to file usage listing.');
$this->assertSession()->linkExists($node->getTitle());
}
/**
......
......@@ -58,12 +58,12 @@ public function testNewForumTopicsBlock() {
// Create 5 forum topics.
$topics = $this->createForumTopics();
$this->assertLink(t('More'), 0, 'New forum topics block has a "more"-link.');
$this->assertSession()->linkExists(t('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.
foreach ($topics as $topic) {
$this->assertLink($topic, 0, new FormattableMarkup('Forum topic @topic found in the "New forum topics" block.', ['@topic' => $topic]));
$this->assertSession()->linkExists($topic, 0, new FormattableMarkup('Forum topic @topic found in the "New forum topics" block.', ['@topic' => $topic]));
}
// Configure the new forum topics block to only show 2 topics.
......@@ -75,7 +75,7 @@ public function testNewForumTopicsBlock() {
// topics" block.
for ($index = 0; $index < 5; $index++) {
if (in_array($index, [3, 4])) {
$this->assertLink($topics[$index], 0, new FormattableMarkup('Forum topic @topic found in the "New forum topics" block.', ['@topic' => $topics[$index]]));
$this->assertSession()->linkExists($topics[$index], 0, new FormattableMarkup('Forum topic @topic found in the "New forum topics" block.', ['@topic' => $topics[$index]]));
}
else {
$this->assertNoText($topics[$index], new FormattableMarkup('Forum topic @topic not found in the "New forum topics" block.', ['@topic' => $topics[$index]]));
......@@ -113,7 +113,7 @@ public function testActiveForumTopicsBlock() {
// Enable the block.
$block = $this->drupalPlaceBlock('forum_active_block');
$this->drupalGet('');
$this->assertLink(t('More'), 0, 'Active forum topics block has a "more"-link.');
$this->assertSession()->linkExists(t('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"
......@@ -121,7 +121,7 @@ public function testActiveForumTopicsBlock() {
$this->drupalGet('<front>');
for ($index = 0; $index < 10; $index++) {
if ($index < 5) {
$this->assertLink($topics[$index], 0, new FormattableMarkup('Forum topic @topic found in the "Active forum topics" block.', ['@topic' => $topics[$index]]));
$this->assertSession()->linkExists($topics[$index], 0, new FormattableMarkup('Forum topic @topic found in the "Active forum topics" block.', ['@topic' => $topics[$index]]));
}
else {
$this->assertNoText($topics[$index], new FormattableMarkup('Forum topic @topic not found in the "Active forum topics" block.', ['@topic' => $topics[$index]]));
......@@ -138,7 +138,7 @@ public function testActiveForumTopicsBlock() {
// the "Active forum topics" block.
for ($index = 0; $index < 10; $index++) {
if (in_array($index, [3, 4])) {
$this->assertLink($topics[$index], 0, 'Forum topic found in the "Active forum topics" block.');
$this->assertSession()->linkExists($topics[$index], 0, 'Forum topic found in the "Active forum topics" block.');
}
else {
$this->assertNoText($topics[$index], 'Forum topic not found in the "Active forum topics" block.');
......
......@@ -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->assertLink(t('Add new Forum topic'));
$this->assertSession()->linkExists(t('Add new Forum topic'));
$this->drupalGet('forum/' . $this->forum['tid']);
$this->assertLink(t('Add new Forum topic'));
$this->assertSession()->linkExists(t('Add new Forum topic'));
// Log in a user with permission to edit any forum content.
$this->drupalLogin($this->editAnyTopicsUser);
......@@ -256,7 +256,7 @@ public function testForum() {
// Test anonymous action link.
$this->drupalLogout();
$this->drupalGet('forum/' . $this->forum['tid']);
$this->assertLink(t('Log in to post new content in the forum.'));
$this->assertSession()->linkExists(t('Log in to post new content in the forum.'));
}
/**
......@@ -319,8 +319,8 @@ private function doAdminTests($user) {
// Verify help text is shown.
$this->assertText(t('Forums contain forum topics. Use containers to group related forums'));
// Verify action links are there.
$this->assertLink('Add forum');
$this->assertLink('Add container');
$this->assertSession()->linkExists('Add forum');
$this->assertSession()->linkExists('Add container');
$this->clickLink('edit container');
$this->assertRaw('Edit container', 'Followed the link to edit the container');
// Create forum inside the forum container.
......@@ -365,7 +365,7 @@ private function doAdminTests($user) {
// Test tags vocabulary form is not affected.
$this->drupalGet('admin/structure/taxonomy/manage/tags');
$this->assertSession()->buttonExists('Save');
$this->assertLink(t('Delete'));
$this->assertSession()->linkExists(t('Delete'));
// Test tags vocabulary term form is not affected.
$this->drupalGet('admin/structure/taxonomy/manage/tags/add');
$this->assertField('parent[]', 'Parent field found.');
......
......@@ -91,7 +91,7 @@ public function testForumUninstallWithField() {
// Ensure that the forum node type can not be deleted.
$this->drupalGet('admin/structure/types/manage/forum');
$this->assertNoLink(t('Delete'));
$this->assertSession()->linkNotExists(t('Delete'));
// Now attempt to uninstall forum.
$this->drupalGet('admin/modules/uninstall');
......
......@@ -82,7 +82,7 @@ public function testHelp() {
// Make sure links are properly added for modules implementing hook_help().
foreach ($this->getModuleList() as $module => $name) {
$this->assertLink($name, 0, new FormattableMarkup('Link properly added to @name (admin/help/@module)', ['@module' => $module, '@name' => $name]));
$this->assertSession()->linkExists($name, 0, new FormattableMarkup('Link properly added to @name (admin/help/@module)', ['@module' => $module, '@name' => $name]));
}
// Ensure that module which does not provide an module overview page is
......@@ -99,7 +99,7 @@ public function testHelp() {
$pos = $start;