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

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

Issue #3153143 by ridhimaabrol24, Hardik_Patel_12, siddhant.bhosale, guptahemant, quietone, paulocs: Remove uses of t() in linkExists() and linkNotExists() calls
parent c7558c41
......@@ -91,7 +91,7 @@ public function testTrackerAll() {
$this->drupalGet('activity');
$this->assertNoText($unpublished->label(), 'Unpublished node does not show up in the tracker listing.');
$this->assertText($published->label(), 'Published node shows up in the tracker listing.');
$this->assertSession()->linkExists(t('My recent content'), 0, 'User tab shows up on the global tracker page.');
$this->assertSession()->linkExists('My recent content', 0, 'User tab shows up on the global tracker page.');
// Assert cache contexts, specifically the pager and node access contexts.
$this->assertCacheContexts(['languages:language_interface', 'route', 'theme', 'url.query_args:' . MainContentViewSubscriber::WRAPPER_FORMAT, 'url.query_args.pagers:0', 'user.node_grants:view', 'user']);
......
......@@ -92,11 +92,11 @@ public function testUploadModule() {
$this->assertFileExists($installedInfoFilePath);
// Ensure the links are relative to the site root and not
// core/authorize.php.
$this->assertSession()->linkExists(t('Install another module'));
$this->assertSession()->linkExists('Install another module');
$this->assertLinkByHref(Url::fromRoute('update.module_install')->toString());
$this->assertSession()->linkExists(t('Enable newly added modules'));
$this->assertSession()->linkExists('Enable newly added modules');
$this->assertLinkByHref(Url::fromRoute('system.modules_list')->toString());
$this->assertSession()->linkExists(t('Administration pages'));
$this->assertSession()->linkExists('Administration pages');
$this->assertLinkByHref(Url::fromRoute('system.admin')->toString());
// Ensure we can reach the "Install another module" link.
$this->clickLink(t('Install another module'));
......
......@@ -137,7 +137,7 @@ public function testAccountPageTitles() {
// Check the page title for registered users is "My Account" in menus.
$this->drupalLogin($this->drupalCreateUser());
// After login, the client is redirected to /user.
$this->assertSession()->linkExists(t('My account'), 0, "Page title of /user is 'My Account' in menus for registered users");
$this->assertSession()->linkExists('My account', 0, "Page title of /user is 'My Account' in menus for registered users");
$this->assertLinkByHref(\Drupal::urlGenerator()->generate('user.page'), 0);
}
......
......@@ -109,7 +109,7 @@ public function testUserPasswordReset() {
// Check successful login.
$this->drupalPostForm(NULL, NULL, t('Log in'));
$this->assertSession()->linkExists(t('Log out'));
$this->assertSession()->linkExists('Log out');
$this->assertSession()->titleEquals($this->account->getAccountName() . ' | Drupal');
// Change the forgotten password.
......@@ -188,7 +188,7 @@ public function testUserPasswordReset() {
$this->drupalPostForm(NULL, $edit, t('Submit'));
$reset_url = $this->getResetURL();
$this->drupalGet($reset_url . '/login');
$this->assertSession()->linkExists(t('Log out'));
$this->assertSession()->linkExists('Log out');
$this->assertSession()->titleEquals($this->account->getAccountName() . ' | Drupal');
// Ensure blocked and deleted accounts can't access the user.reset.login
......@@ -358,7 +358,7 @@ public function testUserResetPasswordUserFloodControlIsCleared() {
// Use the last password reset URL which was generated.
$reset_url = $this->getResetURL();
$this->drupalGet($reset_url . '/login');
$this->assertSession()->linkExists(t('Log out'));
$this->assertSession()->linkExists('Log out');
$this->assertSession()->titleEquals($this->account->getAccountName() . ' | Drupal');
$this->drupalLogout();
......
......@@ -35,7 +35,7 @@ public function testAnalyzeBasic() {
$this->drupalLogin($this->adminUser);
$this->drupalGet('admin/structure/views/view/test_view/edit');
$this->assertSession()->linkExists(t('Analyze view'));
$this->assertSession()->linkExists('Analyze view');
// This redirects the user to the analyze form.
$this->clickLink(t('Analyze view'));
......
......@@ -53,7 +53,7 @@ public function testDefaultViews() {
// It should not be possible to revert the view yet.
// @todo Figure out how to handle this with the new configuration system.
// $this->assertSession()->linkNotExists(t('Revert'));
// $this->assertSession()->linkNotExists('Revert');
// $revert_href = 'admin/structure/views/view/glossary/revert';
// $this->assertNoLinkByHref($revert_href);
......@@ -81,7 +81,7 @@ public function testDefaultViews() {
// It should now be possible to revert the view. Do that, and make sure the
// view title we added above no longer is displayed.
// $this->drupalGet('admin/structure/views');
// $this->assertSession()->linkExists(t('Revert'));
// $this->assertSession()->linkExists('Revert');
// $this->assertLinkByHref($revert_href);
// $this->drupalPostForm($revert_href, array(), t('Revert'));
// $this->drupalGet('glossary');
......
......@@ -57,7 +57,7 @@ protected function doBasicPathUITest() {
// Add a new page display and check the appearing text.
$this->drupalPostForm(NULL, [], 'Add Page');
$this->assertText(t('No path is set'), 'The right text appears if no path was set.');
$this->assertSession()->linkNotExists(t('View @display', ['@display' => 'page']), 'No view page link found on the page.');
$this->assertSession()->linkNotExists('View page', 'No view page link found on the page.');
// Save a path and make sure the summary appears as expected.
$random_path = $this->randomMachineName();
......@@ -159,7 +159,7 @@ public function testMenuOptions() {
$this->assertUrl('admin/structure/views/view/test_view/edit/page_1');
$this->drupalGet('admin/structure/views/view/test_view');
$this->assertSession()->linkExists(t('Tab: @title', ['@title' => 'Test tab title']));
$this->assertSession()->linkExists('Tab: Test tab title');
// If it's a default tab, it should also have an additional settings link.
$this->assertLinkByHref('admin/structure/views/nojs/display/test_view/page_1/tab_options');
......
......@@ -173,7 +173,7 @@ public function testLinkDisplay() {
// The form redirects to the master display.
$this->drupalGet($path);
$this->assertSession()->linkExists(t('Custom URL'), 0, 'The link option has custom URL as summary.');
$this->assertSession()->linkExists('Custom URL', 0, 'The link option has custom URL as summary.');
// Test the default link_url value for new display
$this->drupalPostForm(NULL, [], t('Add Block'));
......
......@@ -52,7 +52,7 @@ public function testRowUI() {
$this->assertFieldByName('row_options[test_option]', $random_name, 'Make sure the custom settings form field has the expected value stored.');
$this->drupalPostForm($view_edit_url, [], t('Save'));
$this->assertSession()->linkExists(t('Test row plugin'), 0, 'Make sure the test row plugin is shown in the UI');
$this->assertSession()->linkExists('Test row plugin', 0, 'Make sure the test row plugin is shown in the UI');
$view = Views::getView($view_name);
$view->initDisplay();
......
......@@ -76,7 +76,7 @@ public function testEditUI() {
$view['id'] = strtolower($this->randomMachineName());
$this->drupalPostForm('admin/structure/views/add', $view, t('Save and edit'));
$this->assertSession()->linkNotExists(t('Master'));
$this->assertSession()->linkNotExists('Master');
// Configure to always show the advanced settings.
// @todo It doesn't seem to be a way to test this as this works just on js.
......
......@@ -51,7 +51,7 @@ public function testStyleUI() {
$this->assertFieldByName('style_options[test_option]', $random_name, 'Make sure the custom settings form field has the expected value stored.');
$this->drupalPostForm($view_edit_url, [], t('Save'));
$this->assertSession()->linkExists(t('Test style plugin'), 0, 'Make sure the test style plugin is shown in the UI');
$this->assertSession()->linkExists('Test style plugin', 0, 'Make sure the test style plugin is shown in the UI');
$view = Views::getView($view_name);
$view->initDisplay();
......
......@@ -29,7 +29,7 @@ class ViewEditTest extends UITestBase {
*/
public function testDeleteLink() {
$this->drupalGet('admin/structure/views/view/test_view');
$this->assertSession()->linkExists(t('Delete view'), 0, 'Ensure that the view delete link appears');
$this->assertSession()->linkExists('Delete view', 0, 'Ensure that the view delete link appears');
$view = $this->container->get('entity_type.manager')->getStorage('view')->load('test_view');
$this->assertInstanceOf(View::class, $view);
......@@ -59,7 +59,7 @@ public function testOtherOptions() {
// Change the machine name for the display from page_1 to test_1.
$edit = ['display_id' => 'test_1'];
$this->drupalPostForm('admin/structure/views/nojs/display/test_view/attachment_1/display_id', $edit, 'Apply');
$this->assertSession()->linkExists(t('test_1'));
$this->assertSession()->linkExists('test_1');
// Save the view, and test the new ID has been saved.
$this->drupalPostForm(NULL, [], 'Save');
......@@ -73,7 +73,7 @@ public function testOtherOptions() {
$edit = ['display_id' => 'test_1'];
$this->drupalPostForm('admin/structure/views/nojs/display/test_view/test_1/display_id', $edit, 'Apply');
$this->drupalPostForm(NULL, [], 'Save');
$this->assertSession()->linkExists(t('test_1'));
$this->assertSession()->linkExists('test_1');
// Test the form validation with invalid IDs.
$machine_name_edit_url = 'admin/structure/views/nojs/display/test_view/test_1/display_id';
......@@ -103,7 +103,7 @@ public function testOtherOptions() {
// Test that the display ID has not been changed.
$this->drupalGet('admin/structure/views/view/test_view/edit/test_1');
$this->assertSession()->linkExists(t('test_1'));
$this->assertSession()->linkExists('test_1');
// Test that validation does not run on cancel.
$this->drupalGet('admin/structure/views/view/test_view');
......@@ -136,8 +136,8 @@ public function testEditFormLanguageOptions() {
$this->assertSession()->statusCodeEquals(200);
$langcode_url = 'admin/structure/views/nojs/display/' . $view_name . '/' . $display . '/rendering_language';
$this->assertNoLinkByHref($langcode_url);
$assert_session->linkNotExistsExact(t('@type language selected for page', ['@type' => t('Content')]));
$this->assertSession()->linkNotExists(t('Content language of view row'));
$assert_session->linkNotExistsExact('Content language selected for page');
$this->assertSession()->linkNotExists('Content language of view row');
}
// Make the site multilingual and test the options again.
......@@ -153,13 +153,13 @@ public function testEditFormLanguageOptions() {
$langcode_url = 'admin/structure/views/nojs/display/' . $view_name . '/' . $display . '/rendering_language';
if ($view_name == 'test_view') {
$this->assertNoLinkByHref($langcode_url);
$assert_session->linkNotExistsExact(t('@type language selected for page', ['@type' => t('Content')]));
$this->assertSession()->linkNotExists(t('Content language of view row'));
$assert_session->linkNotExistsExact('Content language selected for page');
$this->assertSession()->linkNotExists('Content language of view row');
}
else {
$this->assertLinkByHref($langcode_url);
$assert_session->linkNotExistsExact(t('@type language selected for page', ['@type' => t('Content')]));
$this->assertSession()->linkExists(t('Content language of view row'));
$assert_session->linkNotExistsExact('Content language selected for page');
$this->assertSession()->linkExists('Content language of view row');
}
$this->drupalGet($langcode_url);
......
......@@ -50,7 +50,7 @@ public function testViewsListLimit() {
// Check if we can access the main views admin page.
$this->drupalGet('admin/structure/views');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->linkExists(t('Add view'));
$this->assertSession()->linkExists('Add view');
// Check that there is a link to the content view without a destination
// parameter.
......
......@@ -28,7 +28,7 @@ class MinimalTest extends BrowserTestBase {
public function testMinimal() {
$this->drupalGet('');
// Check the login block is present.
$this->assertSession()->linkExists(t('Create new account'));
$this->assertSession()->linkExists('Create new account');
$this->assertSession()->statusCodeEquals(200);
// Create a user to test tools and navigation blocks for logged in users
......
......@@ -38,7 +38,7 @@ class StandardTest extends BrowserTestBase {
*/
public function testStandard() {
$this->drupalGet('');
$this->assertSession()->linkExists(t('Contact'));
$this->assertSession()->linkExists('Contact');
$this->clickLink(t('Contact'));
$this->assertSession()->statusCodeEquals(200);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment