Issue #3153469 by longwave, hmendes, Hardik_Patel_12: Remove uses of t() in clickLink() calls
parent
6ad96bed0d
commit
87feede3a0
|
@ -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');
|
||||
|
|
|
@ -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()]));
|
||||
}
|
||||
|
||||
|
|
|
@ -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()]));
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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() . '?');
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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']]));
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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.');
|
||||
|
|
|
@ -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'));
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
|
|
@ -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]));
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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]);
|
||||
}
|
||||
|
||||
|
|
|
@ -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.');
|
||||
|
|
|
@ -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('<front>');
|
||||
|
@ -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),
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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']]));
|
||||
|
|
|
@ -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.');
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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]));
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
|
|
@ -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.');
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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 <em class="placeholder">Bartik</em> theme has been uninstalled');
|
||||
// Seven is the second in the list.
|
||||
$this->clickLink(t('Uninstall'));
|
||||
$this->clickLink('Uninstall');
|
||||
$this->assertRaw('The <em class="placeholder">Seven</em> theme has been uninstalled');
|
||||
|
||||
// Check that the classy theme still can't be uninstalled as it is hidden.
|
||||
|
|
|
@ -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.');
|
||||
}
|
||||
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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.');
|
||||
}
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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.');
|
||||
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
|
@ -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.');
|
||||
|
|
|
@ -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('<none>', [], ['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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
|
@ -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', '<title>' . $view['page[title]'] . '</title>');
|
||||
|
||||
|
|
|
@ -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()]));
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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 = [
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue