Unverified Commit 472b1901 authored by alexpott's avatar alexpott
Browse files

Issue #3139418 by mondrake, jungle, longwave: Replace usages of...

Issue #3139418 by mondrake, jungle, longwave: Replace usages of AssertLegacyTrait::assert(No)LinkByHref, that is deprecated
parent cf2039b9
......@@ -39,7 +39,7 @@ public function testRSS091Sample() {
$this->drupalGet('aggregator/sources/' . $feed->id());
$this->assertSession()->statusCodeEquals(200);
$this->assertText('First example feed item title');
$this->assertLinkByHref('http://example.com/example-turns-one');
$this->assertSession()->linkByHrefExists('http://example.com/example-turns-one');
$this->assertText('First example feed item description.');
$this->assertRaw('<img src="http://example.com/images/druplicon.png"');
......@@ -47,10 +47,10 @@ public function testRSS091Sample() {
$this->assertRaw("Second example feed item title.");
$this->assertText('Long link feed item title');
$this->assertText('Long link feed item description');
$this->assertLinkByHref('http://example.com/tomorrow/and/tomorrow/and/tomorrow/creeps/in/this/petty/pace/from/day/to/day/to/the/last/syllable/of/recorded/time/and/all/our/yesterdays/have/lighted/fools/the/way/to/dusty/death/out/out/brief/candle/life/is/but/a/walking/shadow/a/poor/player/that/struts/and/frets/his/hour/upon/the/stage/and/is/heard/no/more/it/is/a/tale/told/by/an/idiot/full/of/sound/and/fury/signifying/nothing');
$this->assertSession()->linkByHrefExists('http://example.com/tomorrow/and/tomorrow/and/tomorrow/creeps/in/this/petty/pace/from/day/to/day/to/the/last/syllable/of/recorded/time/and/all/our/yesterdays/have/lighted/fools/the/way/to/dusty/death/out/out/brief/candle/life/is/but/a/walking/shadow/a/poor/player/that/struts/and/frets/his/hour/upon/the/stage/and/is/heard/no/more/it/is/a/tale/told/by/an/idiot/full/of/sound/and/fury/signifying/nothing');
$this->assertText('Long author feed item title');
$this->assertText('Long author feed item description');
$this->assertLinkByHref('http://example.com/long/author');
$this->assertSession()->linkByHrefExists('http://example.com/long/author');
}
/**
......@@ -62,7 +62,7 @@ public function testAtomSample() {
$this->drupalGet('aggregator/sources/' . $feed->id());
$this->assertSession()->statusCodeEquals(200);
$this->assertText('Atom-Powered Robots Run Amok');
$this->assertLinkByHref('http://example.org/2003/12/13/atom03');
$this->assertSession()->linkByHrefExists('http://example.org/2003/12/13/atom03');
$this->assertText('Some text.');
$item_ids = \Drupal::entityQuery('aggregator_item')->condition('link', 'http://example.org/2003/12/13/atom03')->execute();
$item = Item::load(array_values($item_ids)[0]);
......@@ -70,7 +70,7 @@ public function testAtomSample() {
// Check for second feed entry.
$this->assertText('We tried to stop them, but we failed.');
$this->assertLinkByHref('http://example.org/2003/12/14/atom03');
$this->assertSession()->linkByHrefExists('http://example.org/2003/12/14/atom03');
$this->assertText('Some other text.');
$item_ids = \Drupal::entityQuery('aggregator_item')->condition('link', 'http://example.org/2003/12/14/atom03')->execute();
$item = Item::load(array_values($item_ids)[0]);
......
......@@ -39,8 +39,8 @@ public function testBlockDemo() {
$default_theme = $config->get('default');
$this->drupalGet('admin/structure/block/demo/' . $default_theme);
$this->assertSession()->statusCodeEquals(200);
$this->assertLinkByHref('admin/structure/block');
$this->assertNoLinkByHref('admin/structure/block/list/' . $default_theme);
$this->assertSession()->linkByHrefExists('admin/structure/block');
$this->assertSession()->linkByHrefNotExists('admin/structure/block/list/' . $default_theme);
// All available themes in core.
$available_themes = [
......@@ -60,7 +60,7 @@ public function testBlockDemo() {
$this->drupalGet('admin/structure/block/demo/' . $theme);
$this->assertSession()->statusCodeEquals(200);
// Confirm existence of link for "Exit block region demonstration".
$this->assertLinkByHref('admin/structure/block/list/' . $theme);
$this->assertSession()->linkByHrefExists('admin/structure/block/list/' . $theme);
}
// Confirm access to the block demo page is denied for an invalid theme.
......
......@@ -49,7 +49,7 @@ public function testBlockOperationAlter() {
$test_operation_link = 'admin/structure/block/manage/' . $block_id . '/test_operation';
// Test if the test_operation link is on the page.
$this->assertLinkByHref($test_operation_link);
$this->assertSession()->linkByHrefExists($test_operation_link);
}
}
......@@ -481,7 +481,7 @@ public function testThemeAdminLink() {
$this->drupalLogin($theme_admin);
$this->drupalGet('admin/appearance');
$this->assertText('You can place blocks for each theme on the block layout page');
$this->assertLinkByHref('admin/structure/block');
$this->assertSession()->linkByHrefExists('admin/structure/block');
}
/**
......
......@@ -85,7 +85,7 @@ public function testListing() {
->loadByProperties(['info' => $label]);
$block = reset($blocks);
if (!empty($block)) {
$this->assertLinkByHref('block/' . $block->id());
$this->assertSession()->linkByHrefExists('block/' . $block->id());
$this->clickLink(t('Edit'));
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->titleEquals("Edit custom block $label | Drupal");
......@@ -101,7 +101,7 @@ public function testListing() {
$this->assertFieldByXpath('//td', $new_label, 'Label found for updated custom block.');
// Delete the added entity using the operations link.
$this->assertLinkByHref('block/' . $block->id() . '/delete');
$this->assertSession()->linkByHrefExists('block/' . $block->id() . '/delete');
$delete_text = t('Delete');
$this->clickLink($delete_text);
$this->assertSession()->statusCodeEquals(200);
......
......@@ -97,7 +97,7 @@ public function testListing() {
->loadByProperties(['info' => $label]);
$block = reset($blocks);
if (!empty($block)) {
$this->assertLinkByHref('block/' . $block->id());
$this->assertSession()->linkByHrefExists('block/' . $block->id());
$this->clickLink(t('Edit'));
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->titleEquals("Edit custom block $label | Drupal");
......@@ -113,7 +113,7 @@ public function testListing() {
$this->assertFieldByXpath('//td/a', $new_label, 'Label found for updated custom block.');
// Delete the added entity using the operations link.
$this->assertLinkByHref('block/' . $block->id() . '/delete');
$this->assertSession()->linkByHrefExists('block/' . $block->id() . '/delete');
$delete_text = t('Delete');
$this->clickLink($delete_text);
$this->assertSession()->statusCodeEquals(200);
......
......@@ -126,7 +126,7 @@ protected function doTestBasicTranslation() {
// Check that the translate operation link is shown.
$this->drupalGet('admin/structure/block/block-content');
$this->assertLinkByHref('block/' . $entity->id() . '/translations');
$this->assertSession()->linkByHrefExists('block/' . $entity->id() . '/translations');
}
/**
......
......@@ -215,7 +215,7 @@ public function testsBlockContentAddTypes() {
// The seven theme has markup inside the link, we cannot use clickLink().
if ($default_theme == 'seven') {
$options = $theme != $default_theme ? ['query' => ['theme' => $theme]] : [];
$this->assertLinkByHref(Url::fromRoute('block_content.add_form', ['block_content_type' => 'foo'], $options)->toString());
$this->assertSession()->linkByHrefExists(Url::fromRoute('block_content.add_form', ['block_content_type' => 'foo'], $options)->toString());
$this->drupalGet('block/add/foo', $options);
}
else {
......
......@@ -272,7 +272,7 @@ public function testCommentFunctionality() {
// Test that default field exists.
$this->drupalGet('entity_test/structure/entity_test/fields');
$this->assertText(t('Comments'));
$this->assertLinkByHref('entity_test/structure/entity_test/fields/entity_test.entity_test.comment');
$this->assertSession()->linkByHrefExists('entity_test/structure/entity_test/fields/entity_test.entity_test.comment');
// Test widget hidden option is not visible when there's no comments.
$this->drupalGet('entity_test/structure/entity_test/fields/entity_test.entity_test.comment');
$this->assertSession()->statusCodeEquals(200);
......
......@@ -207,8 +207,8 @@ public function testTranslateLinkCommentAdminPage() {
// Verify translation links.
$this->drupalGet('admin/content/comment');
$this->assertSession()->statusCodeEquals(200);
$this->assertLinkByHref('comment/' . $cid_translatable . '/translations');
$this->assertNoLinkByHref('comment/' . $cid_untranslatable . '/translations');
$this->assertSession()->linkByHrefExists('comment/' . $cid_translatable . '/translations');
$this->assertSession()->linkByHrefNotExists('comment/' . $cid_untranslatable . '/translations');
}
/**
......
......@@ -48,7 +48,7 @@ public function testListUI() {
// Get the list page.
$this->drupalGet('admin/structure/config_test');
$this->assertLinkByHref('admin/structure/config_test/manage/dotted.default');
$this->assertSession()->linkByHrefExists('admin/structure/config_test/manage/dotted.default');
// Add a new entity using the action link.
$this->clickLink('Add test configuration');
......@@ -59,13 +59,13 @@ public function testListUI() {
];
$this->drupalPostForm(NULL, $edit, t('Save'));
// Ensure that operations for editing the Hungarian entity appear in English.
$this->assertLinkByHref('admin/structure/config_test/manage/antilop');
$this->assertSession()->linkByHrefExists('admin/structure/config_test/manage/antilop');
// Get the list page in Hungarian and assert Hungarian admin links
// regardless of language of config entities.
$this->drupalGet('hu/admin/structure/config_test');
$this->assertLinkByHref('hu/admin/structure/config_test/manage/dotted.default');
$this->assertLinkByHref('hu/admin/structure/config_test/manage/antilop');
$this->assertSession()->linkByHrefExists('hu/admin/structure/config_test/manage/dotted.default');
$this->assertSession()->linkByHrefExists('hu/admin/structure/config_test/manage/antilop');
}
}
......@@ -213,7 +213,7 @@ public function testListUI() {
$this->assertFieldByXpath('//td', 'antelope', "Machine name found for added 'Antelope' entity.");
// Edit the entity using the operations link.
$this->assertLinkByHref('admin/structure/config_test/manage/antelope');
$this->assertSession()->linkByHrefExists('admin/structure/config_test/manage/antelope');
$this->clickLink('Edit', 1);
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->titleEquals('Edit Antelope | Drupal');
......@@ -227,7 +227,7 @@ public function testListUI() {
$this->assertFieldByXpath('//td', 'albatross', "Machine name found for updated 'Albatross' entity.");
// Delete the added entity using the operations link.
$this->assertLinkByHref('admin/structure/config_test/manage/albatross/delete');
$this->assertSession()->linkByHrefExists('admin/structure/config_test/manage/albatross/delete');
$this->clickLink('Delete', 1);
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->titleEquals('Are you sure you want to delete the test configuration Albatross? | Drupal');
......
......@@ -42,17 +42,17 @@ public function testCRUD() {
// Disable an entity.
$disable_url = $entity->toUrl('disable');
$this->assertLinkByHref($disable_url->toString());
$this->assertSession()->linkByHrefExists($disable_url->toString());
$this->drupalGet($disable_url);
$this->assertSession()->statusCodeEquals(200);
$this->assertNoLinkByHref($disable_url->toString());
$this->assertSession()->linkByHrefNotExists($disable_url->toString());
// Enable an entity.
$enable_url = $entity->toUrl('enable');
$this->assertLinkByHref($enable_url->toString());
$this->assertSession()->linkByHrefExists($enable_url->toString());
$this->drupalGet($enable_url);
$this->assertSession()->statusCodeEquals(200);
$this->assertNoLinkByHref($enable_url->toString());
$this->assertSession()->linkByHrefNotExists($enable_url->toString());
}
}
......@@ -248,7 +248,7 @@ public function testCRUDUI() {
$this->assertSession()->statusCodeEquals(200);
$this->assertRaw($message_insert);
$this->assertNoRaw($message_update);
$this->assertLinkByHref("admin/structure/config_test/manage/$id");
$this->assertSession()->linkByHrefExists("admin/structure/config_test/manage/$id");
// Update the configuration entity.
$edit = [
......@@ -259,8 +259,8 @@ public function testCRUDUI() {
$this->assertSession()->statusCodeEquals(200);
$this->assertNoRaw($message_insert);
$this->assertRaw($message_update);
$this->assertLinkByHref("admin/structure/config_test/manage/$id");
$this->assertLinkByHref("admin/structure/config_test/manage/$id/delete");
$this->assertSession()->linkByHrefExists("admin/structure/config_test/manage/$id");
$this->assertSession()->linkByHrefExists("admin/structure/config_test/manage/$id/delete");
// Delete the configuration entity.
$this->drupalGet("admin/structure/config_test/manage/$id");
......@@ -272,7 +272,7 @@ public function testCRUDUI() {
$this->assertNoRaw($message_update);
$this->assertRaw($message_delete);
$this->assertNoText($label1);
$this->assertNoLinkByHref("admin/structure/config_test/manage/$id");
$this->assertSession()->linkByHrefNotExists("admin/structure/config_test/manage/$id");
// Re-create a configuration entity.
$edit = [
......@@ -283,7 +283,7 @@ public function testCRUDUI() {
$this->assertSession()->addressEquals('admin/structure/config_test');
$this->assertSession()->statusCodeEquals(200);
$this->assertText($label1);
$this->assertLinkByHref("admin/structure/config_test/manage/$id");
$this->assertSession()->linkByHrefExists("admin/structure/config_test/manage/$id");
// Rename the configuration entity's ID/machine name.
$edit = [
......@@ -296,9 +296,9 @@ public function testCRUDUI() {
$this->assertNoText($label1);
$this->assertNoText($label2);
$this->assertText($label3);
$this->assertNoLinkByHref("admin/structure/config_test/manage/$id");
$this->assertSession()->linkByHrefNotExists("admin/structure/config_test/manage/$id");
$id = $edit['id'];
$this->assertLinkByHref("admin/structure/config_test/manage/$id");
$this->assertSession()->linkByHrefExists("admin/structure/config_test/manage/$id");
// Create a configuration entity with '0' machine name.
$edit = [
......@@ -309,8 +309,8 @@ public function testCRUDUI() {
$this->assertSession()->statusCodeEquals(200);
$message_insert = new FormattableMarkup('%label configuration has been created.', ['%label' => $edit['label']]);
$this->assertRaw($message_insert);
$this->assertLinkByHref('admin/structure/config_test/manage/0');
$this->assertLinkByHref('admin/structure/config_test/manage/0/delete');
$this->assertSession()->linkByHrefExists('admin/structure/config_test/manage/0');
$this->assertSession()->linkByHrefExists('admin/structure/config_test/manage/0/delete');
$this->drupalPostForm('admin/structure/config_test/manage/0/delete', [], 'Delete');
$storage = \Drupal::entityTypeManager()->getStorage('config_test');
$this->assertNull($storage->load(0), 'Test entity deleted');
......
......@@ -282,17 +282,17 @@ public function testExportImportCollections() {
$this->assertText(t('@collection configuration collection', ['@collection' => 'collection.test1']));
$this->assertText(t('@collection configuration collection', ['@collection' => 'collection.test2']));
$this->assertText('config_test.create');
$this->assertLinkByHref('admin/config/development/configuration/sync/diff_collection/collection.test1/config_test.create');
$this->assertSession()->linkByHrefExists('admin/config/development/configuration/sync/diff_collection/collection.test1/config_test.create');
$this->assertText('config_test.update');
$this->assertLinkByHref('admin/config/development/configuration/sync/diff_collection/collection.test1/config_test.update');
$this->assertSession()->linkByHrefExists('admin/config/development/configuration/sync/diff_collection/collection.test1/config_test.update');
$this->assertText('config_test.delete');
$this->assertLinkByHref('admin/config/development/configuration/sync/diff_collection/collection.test1/config_test.delete');
$this->assertSession()->linkByHrefExists('admin/config/development/configuration/sync/diff_collection/collection.test1/config_test.delete');
$this->assertText('config_test.another_create');
$this->assertLinkByHref('admin/config/development/configuration/sync/diff_collection/collection.test2/config_test.another_create');
$this->assertSession()->linkByHrefExists('admin/config/development/configuration/sync/diff_collection/collection.test2/config_test.another_create');
$this->assertText('config_test.another_update');
$this->assertLinkByHref('admin/config/development/configuration/sync/diff_collection/collection.test2/config_test.another_update');
$this->assertSession()->linkByHrefExists('admin/config/development/configuration/sync/diff_collection/collection.test2/config_test.another_update');
$this->assertText('config_test.another_delete');
$this->assertLinkByHref('admin/config/development/configuration/sync/diff_collection/collection.test2/config_test.another_delete');
$this->assertSession()->linkByHrefExists('admin/config/development/configuration/sync/diff_collection/collection.test2/config_test.another_delete');
$this->drupalPostForm(NULL, [], 'Import all');
$this->assertText(t('There are no configuration changes to import.'));
......
......@@ -46,10 +46,10 @@ public function testDateFormatUI() {
$this->drupalGet('admin/config/regional/date-time');
// Assert translation link unlocked date format.
$this->assertLinkByHref('admin/config/regional/date-time/formats/manage/medium/translate');
$this->assertSession()->linkByHrefExists('admin/config/regional/date-time/formats/manage/medium/translate');
// Assert translation link locked date format.
$this->assertLinkByHref('admin/config/regional/date-time/formats/manage/html_datetime/translate');
$this->assertSession()->linkByHrefExists('admin/config/regional/date-time/formats/manage/html_datetime/translate');
// Date pattern is visible on unlocked date formats.
$this->drupalGet('admin/config/regional/date-time/formats/manage/medium/translate/de/add');
......
......@@ -106,7 +106,7 @@ protected function doBlockListTest() {
$translate_link = 'admin/structure/block/manage/' . $id . '/translate';
// Test if the link to translate the block is on the page.
$this->assertLinkByHref($translate_link);
$this->assertSession()->linkByHrefExists($translate_link);
// Test if the link to translate actually goes to the translate page.
$this->drupalGet($translate_link);
......@@ -136,7 +136,7 @@ protected function doMenuListTest() {
$translate_link = 'admin/structure/menu/manage/' . $menu_name . '/translate';
// Test if the link to translate the menu is on the page.
$this->assertLinkByHref($translate_link);
$this->assertSession()->linkByHrefExists($translate_link);
// Check if the Link is not added if you are missing 'translate
// configuration' permission.
......@@ -150,7 +150,7 @@ protected function doMenuListTest() {
$translate_link = 'admin/structure/menu/manage/' . $menu_name . '/translate';
// Test if the link to translate the menu is NOT on the page.
$this->assertNoLinkByHref($translate_link);
$this->assertSession()->linkByHrefNotExists($translate_link);
// Log in as Admin again otherwise the rest will fail.
$this->drupalLogin($this->adminUser);
......@@ -178,7 +178,7 @@ protected function doVocabularyListTest() {
$translate_link = 'admin/structure/taxonomy/manage/' . $vocabulary->id() . '/translate';
// Test if the link to translate the vocabulary is on the page.
$this->assertLinkByHref($translate_link);
$this->assertSession()->linkByHrefExists($translate_link);
// Test if the link to translate actually goes to the translate page.
$this->drupalGet($translate_link);
......@@ -203,7 +203,7 @@ public function doCustomContentTypeListTest() {
$translate_link = 'admin/structure/block/block-content/manage/' . $block_content_type->id() . '/translate';
// Test if the link to translate the custom block type is on the page.
$this->assertLinkByHref($translate_link);
$this->assertSession()->linkByHrefExists($translate_link);
// Test if the link to translate actually goes to the translate page.
$this->drupalGet($translate_link);
......@@ -227,7 +227,7 @@ public function doContactFormsListTest() {
$translate_link = 'admin/structure/contact/manage/' . $contact_form->id() . '/translate';
// Test if the link to translate the contact form is on the page.
$this->assertLinkByHref($translate_link);
$this->assertSession()->linkByHrefExists($translate_link);
// Test if the link to translate actually goes to the translate page.
$this->drupalGet($translate_link);
......@@ -250,7 +250,7 @@ public function doContentTypeListTest() {
$translate_link = 'admin/structure/types/manage/' . $content_type->id() . '/translate';
// Test if the link to translate the content type is on the page.
$this->assertLinkByHref($translate_link);
$this->assertSession()->linkByHrefExists($translate_link);
// Test if the link to translate actually goes to the translate page.
$this->drupalGet($translate_link);
......@@ -274,7 +274,7 @@ public function doFormatsListTest() {
$translate_link = 'admin/config/content/formats/manage/' . $filter_format->id() . '/translate';
// Test if the link to translate the format is on the page.
$this->assertLinkByHref($translate_link);
$this->assertSession()->linkByHrefExists($translate_link);
// Test if the link to translate actually goes to the translate page.
$this->drupalGet($translate_link);
......@@ -298,7 +298,7 @@ public function doShortcutListTest() {
$translate_link = 'admin/config/user-interface/shortcut/manage/' . $shortcut->id() . '/translate';
// Test if the link to translate the shortcut is on the page.
$this->assertLinkByHref($translate_link);
$this->assertSession()->linkByHrefExists($translate_link);
// Test if the link to translate actually goes to the translate page.
$this->drupalGet($translate_link);
......@@ -319,7 +319,7 @@ public function doUserRoleListTest() {
$translate_link = 'admin/people/roles/manage/' . $role_id . '/translate';
// Test if the link to translate the role is on the page.
$this->assertLinkByHref($translate_link);
$this->assertSession()->linkByHrefExists($translate_link);
// Test if the link to translate actually goes to the translate page.
$this->drupalGet($translate_link);
......@@ -339,7 +339,7 @@ public function doLanguageListTest() {
$translate_link = 'admin/config/regional/language/edit/ga/translate';
// Test if the link to translate the language is on the page.
$this->assertLinkByHref($translate_link);
$this->assertSession()->linkByHrefExists($translate_link);
// Test if the link to translate actually goes to the translate page.
$this->drupalGet($translate_link);
......@@ -355,7 +355,7 @@ public function doImageStyleListTest() {
$translate_link = 'admin/config/media/image-styles/manage/medium/translate';
// Test if the link to translate the style is on the page.
$this->assertLinkByHref($translate_link);
$this->assertSession()->linkByHrefExists($translate_link);
// Test if the link to translate actually goes to the translate page.
$this->drupalGet($translate_link);
......@@ -379,7 +379,7 @@ public function doResponsiveImageListTest() {
$translate_link = 'admin/config/media/responsive-image-style/' . $edit['id'] . '/translate';
// Test if the link to translate the style is on the page.
$this->assertLinkByHref($translate_link);
$this->assertSession()->linkByHrefExists($translate_link);
// Test if the link to translate actually goes to the translate page.
$this->drupalGet($translate_link);
......@@ -431,7 +431,7 @@ public function doFieldListTest() {
$translate_link = $values['list'] . '/' . $values['field'] . '/translate';
// Test if the link to translate the field is on the page.
$this->assertLinkByHref($translate_link);
$this->assertSession()->linkByHrefExists($translate_link);
// Test if the link to translate actually goes to the translate page.
$this->drupalGet($translate_link);
......@@ -448,7 +448,7 @@ public function doDateFormatListTest() {
$translate_link = 'admin/config/regional/date-time/formats/manage/long/translate';
// Test if the link to translate the format is on the page.
$this->assertLinkByHref($translate_link);
$this->assertSession()->linkByHrefExists($translate_link);
// Test if the link to translate actually goes to the translate page.
$this->drupalGet($translate_link);
......@@ -467,7 +467,7 @@ public function doSettingsPageTest($link) {
$translate_link = $link . '/translate';
// Test if the link to translate the settings page is present.
$this->assertLinkByHref($translate_link);
$this->assertSession()->linkByHrefExists($translate_link);
// Test if the link to translate actually goes to the translate page.
$this->drupalGet($translate_link);
......
......@@ -82,8 +82,8 @@ protected function setUp(): void {
*/
public function testMapperListPage() {
$this->drupalGet('admin/config/regional/config-translation');
$this->assertLinkByHref('admin/config/regional/config-translation/config_test');
$this->assertLinkByHref('admin/config/people/accounts/translate');
$this->assertSession()->linkByHrefExists('admin/config/regional/config-translation/config_test');
$this->assertSession()->linkByHrefExists('admin/config/people/accounts/translate');
// Make sure there is only a single operation for each dropbutton, either
// 'List' or 'Translate'.
foreach ($this->cssSelect('ul.dropbutton') as $i => $dropbutton) {
......@@ -107,7 +107,7 @@ public function testMapperListPage() {
$base_url = 'admin/structure/config_test/manage/' . $test_entity->id();
$this->drupalGet('admin/config/regional/config-translation/config_test');
$this->assertLinkByHref($base_url . '/translate');
$this->assertSession()->linkByHrefExists($base_url . '/translate');
$this->assertSession()->assertEscaped($test_entity->label());
// Make sure there is only a single 'Translate' operation for each
......@@ -138,17 +138,17 @@ public function testHiddenEntities() {
// configuration translation listings.
$this->drupalGet('admin/config/regional/config-translation/configurable_language');
$this->assertText('Not applicable');
$this->assertLinkByHref('admin/config/regional/language/edit/zxx/translate');
$this->assertSession()->linkByHrefExists('admin/config/regional/language/edit/zxx/translate');
$this->assertText('Not specified');
$this->assertLinkByHref('admin/config/regional/language/edit/und/translate');
$this->assertSession()->linkByHrefExists('admin/config/regional/language/edit/und/translate');
// Hidden date formats are only available to translate through the
// configuration translation listings. Test a couple of them.
$this->drupalGet('admin/config/regional/config-translation/date_format');
$this->assertText('HTML Date');
$this->assertLinkByHref('admin/config/regional/date-time/formats/manage/html_date/translate');
$this->assertSession()->linkByHrefExists('admin/config/regional/date-time/formats/manage/html_date/translate');
$this->assertText('HTML Year');
$this->assertLinkByHref('admin/config/regional/date-time/formats/manage/html_year/translate');
$this->assertSession()->linkByHrefExists('admin/config/regional/date-time/formats/manage/html_year/translate');
}
/**
......@@ -200,7 +200,7 @@ public function testListingFieldsPage() {
$this->drupalGet('admin/config/regional/config-translation/node_fields');
$this->assertText('Body');
$this->assertText('Basic');
$this->assertLinkByHref('admin/structure/types/manage/basic/fields/node.basic.body/translate');
$this->assertSession()->linkByHrefExists('admin/structure/types/manage/basic/fields/node.basic.body/translate');
}
}
......@@ -145,7 +145,7 @@ public function testSiteInformationTranslationUi() {
$this->drupalGet('admin/config/system/site-information');
// Check translation tab exist.
$this->assertLinkByHref($translation_base_url);
$this->assertSession()->linkByHrefExists($translation_base_url);
$this->drupalGet($translation_base_url);
......@@ -157,7 +157,7 @@ public function testSiteInformationTranslationUi() {
$this->assertSession()->addressEquals($translation_base_url);
// Check 'Add' link of French to visit add page.
$this->assertLinkByHref("$translation_base_url/fr/add");
$this->assertSession()->linkByHrefExists("$translation_base_url/fr/add");
$this->clickLink(t('Add'));
// Make sure original text is present on this page.
......@@ -174,9 +174,9 @@ public function testSiteInformationTranslationUi() {
$this->assertRaw(t('Successfully saved @language translation.', ['@language' => 'French']));
// Check for edit, delete links (and no 'add' link) for French language.
$this->assertNoLinkByHref("$translation_base_url/fr/add");
$this->assertLinkByHref("$translation_base_url/fr/edit");
$this->assertLinkByHref("$translation_base_url/fr/delete");
$this->assertSession()->linkByHrefNotExists("$translation_base_url/fr/add");
$this->assertSession()->linkByHrefExists("$translation_base_url/fr/edit");