From 7ad99c1ee870c683a4927ec21188c62aaa2b98e5 Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Fri, 31 Jul 2020 16:35:50 +0100 Subject: [PATCH] Issue #3153264 by siddhant.bhosale, Hardik_Patel_12, longwave: Remove uses of t() in clickViewsOperationLink(), helperButtonHasLabel() and optionExists() calls --- .../src/Functional/Plugin/ExposedFormTest.php | 6 +++--- .../tests/src/Functional/DefaultViewsTest.php | 20 +++++++++---------- .../src/Functional/ExposedFormUITest.php | 12 +++++------ 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php b/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php index 4ade4aa9df21..690a004fe035 100644 --- a/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php +++ b/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php @@ -58,7 +58,7 @@ public function testSubmitButton() { // Test the submit button value defaults to 'Apply'. $this->drupalGet('test_exposed_form_buttons'); $this->assertSession()->statusCodeEquals(200); - $this->helperButtonHasLabel('edit-submit-test-exposed-form-buttons', t('Apply')); + $this->helperButtonHasLabel('edit-submit-test-exposed-form-buttons', 'Apply'); // Rename the label of the submit button. $view = Views::getView('test_exposed_form_buttons'); @@ -84,7 +84,7 @@ public function testSubmitButton() { // Make sure the submit button label shows 'Apply'. $this->drupalGet('test_exposed_form_buttons'); - $this->helperButtonHasLabel('edit-submit-test-exposed-form-buttons', t('Apply')); + $this->helperButtonHasLabel('edit-submit-test-exposed-form-buttons', 'Apply'); } /** @@ -266,7 +266,7 @@ public function testInputRequired() { $this->drupalGet('test_exposed_form_buttons'); $this->assertSession()->statusCodeEquals(200); - $this->helperButtonHasLabel('edit-submit-test-exposed-form-buttons', t('Apply')); + $this->helperButtonHasLabel('edit-submit-test-exposed-form-buttons', 'Apply'); // Ensure that no results are displayed. $rows = $this->xpath("//div[contains(@class, 'views-row')]"); diff --git a/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php b/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php index 72d2e56f76f3..46bc66a9d2d5 100644 --- a/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php +++ b/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php @@ -47,7 +47,7 @@ public function testDefaultViews() { // Enable the view, and make sure it is now visible on the main listing // page. $this->drupalGet('admin/structure/views'); - $this->clickViewsOperationLink(t('Enable'), '/glossary/'); + $this->clickViewsOperationLink('Enable', '/glossary/'); $this->assertUrl('admin/structure/views'); $this->assertLinkByHref($edit_href); @@ -76,7 +76,7 @@ public function testDefaultViews() { $this->drupalGet('admin/structure/views'); $this->assertLinkByHref('admin/structure/views/view/archive/enable'); // Enable it again so it can be tested for access permissions. - $this->clickViewsOperationLink(t('Enable'), '/archive/'); + $this->clickViewsOperationLink('Enable', '/archive/'); // It should now be possible to revert the view. Do that, and make sure the // view title we added above no longer is displayed. @@ -89,7 +89,7 @@ public function testDefaultViews() { // Duplicate the view and check that the normal schema of duplicated views is used. $this->drupalGet('admin/structure/views'); - $this->clickViewsOperationLink(t('Duplicate'), '/glossary'); + $this->clickViewsOperationLink('Duplicate', '/glossary'); $edit = [ 'id' => 'duplicate_of_glossary', ]; @@ -99,7 +99,7 @@ public function testDefaultViews() { // Duplicate a view and set a custom name. $this->drupalGet('admin/structure/views'); - $this->clickViewsOperationLink(t('Duplicate'), '/glossary'); + $this->clickViewsOperationLink('Duplicate', '/glossary'); $random_name = strtolower($this->randomMachineName()); $this->drupalPostForm(NULL, ['id' => $random_name], t('Duplicate')); $this->assertUrl("admin/structure/views/view/$random_name", [], 'The custom view name got saved.'); @@ -109,13 +109,13 @@ public function testDefaultViews() { // listing page. // @todo Test this behavior with templates instead. $this->drupalGet('admin/structure/views'); - $this->clickViewsOperationLink(t('Disable'), '/glossary/'); + $this->clickViewsOperationLink('Disable', '/glossary/'); // $this->assertUrl('admin/structure/views'); // $this->assertNoLinkByHref($edit_href); // The easiest way to verify it appears on the disabled views listing page // is to try to click the "enable" link from there again. $this->drupalGet('admin/structure/views'); - $this->clickViewsOperationLink(t('Enable'), '/glossary/'); + $this->clickViewsOperationLink('Enable', '/glossary/'); $this->assertUrl('admin/structure/views'); $this->assertLinkByHref($edit_href); @@ -132,7 +132,7 @@ public function testDefaultViews() { // Test deleting a view. $this->drupalLogin($this->fullAdminUser); $this->drupalGet('admin/structure/views'); - $this->clickViewsOperationLink(t('Delete'), '/glossary/'); + $this->clickViewsOperationLink('Delete', '/glossary/'); // Submit the confirmation form. $this->drupalPostForm(NULL, [], t('Delete')); // Ensure the view is no longer listed. @@ -145,7 +145,7 @@ public function testDefaultViews() { // Delete all duplicated Glossary views. $this->drupalGet('admin/structure/views'); - $this->clickViewsOperationLink(t('Delete'), 'duplicate_of_glossary'); + $this->clickViewsOperationLink('Delete', 'duplicate_of_glossary'); // Submit the confirmation form. $this->drupalPostForm(NULL, [], t('Delete')); @@ -153,7 +153,7 @@ public function testDefaultViews() { $this->assertSession()->statusCodeEquals(200); $this->drupalGet('admin/structure/views'); - $this->clickViewsOperationLink(t('Delete'), $random_name); + $this->clickViewsOperationLink('Delete', $random_name); // Submit the confirmation form. $this->drupalPostForm(NULL, [], t('Delete')); $this->drupalGet('glossary'); @@ -183,7 +183,7 @@ public function testSplitListing() { $this->assertCount(1, $elements, 'A disabled view is found in the disabled views table.'); // Enable the view. - $this->clickViewsOperationLink(t('Enable'), '/test_view_status/'); + $this->clickViewsOperationLink('Enable', '/test_view_status/'); $elements = $this->xpath($xpath, $arguments); $this->assertCount(0, $elements, 'After enabling a view, it is not found in the disabled views table.'); diff --git a/core/modules/views_ui/tests/src/Functional/ExposedFormUITest.php b/core/modules/views_ui/tests/src/Functional/ExposedFormUITest.php index dbda21b3bded..131c54495f8f 100644 --- a/core/modules/views_ui/tests/src/Functional/ExposedFormUITest.php +++ b/core/modules/views_ui/tests/src/Functional/ExposedFormUITest.php @@ -69,7 +69,7 @@ public function testExposedAdminUi() { $this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type'); // Be sure that the button is called exposed. - $this->helperButtonHasLabel('edit-options-expose-button-button', t('Expose filter')); + $this->helperButtonHasLabel('edit-options-expose-button-button', 'Expose filter'); // The first time the filter UI is displayed, the operator and the // value forms should be shown. @@ -81,7 +81,7 @@ public function testExposedAdminUi() { // Click the Expose filter button. $this->drupalPostForm('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type', $edit, t('Expose filter')); // Check the label of the expose button. - $this->helperButtonHasLabel('edit-options-expose-button-button', t('Hide filter')); + $this->helperButtonHasLabel('edit-options-expose-button-button', 'Hide filter'); // After exposing the filter, Operator and Value should be still here. $this->assertFieldById('edit-options-operator-in', 'in', 'Operator In exists'); @@ -102,7 +102,7 @@ public function testExposedAdminUi() { // Now check the sort criteria. $this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/sort/created'); - $this->helperButtonHasLabel('edit-options-expose-button-button', t('Expose sort')); + $this->helperButtonHasLabel('edit-options-expose-button-button', 'Expose sort'); $this->assertNoFieldById('edit-options-expose-label', '', 'Make sure no label field is shown'); // Un-expose the filter. @@ -119,7 +119,7 @@ public function testExposedAdminUi() { $edit = []; $this->drupalPostForm('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/sort/created', $edit, t('Expose sort')); // Check the label of the expose button. - $this->helperButtonHasLabel('edit-options-expose-button-button', t('Hide sort')); + $this->helperButtonHasLabel('edit-options-expose-button-button', 'Hide sort'); $this->assertFieldById('edit-options-expose-label', 'Authored on', 'Make sure a label field is shown'); // Test adding a new exposed sort criteria. @@ -154,7 +154,7 @@ public function testGroupedFilterAdminUi() { // Click the Expose filter button. $this->drupalPostForm('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type', $edit, t('Expose filter')); // Check the label of the grouped filters button. - $this->helperButtonHasLabel('edit-options-group-button-button', t('Grouped filters')); + $this->helperButtonHasLabel('edit-options-group-button-button', 'Grouped filters'); // Click the Grouped Filters button. $this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type'); @@ -169,7 +169,7 @@ public function testGroupedFilterAdminUi() { // Check that after click on 'Grouped Filters', a new button is shown to // add more items to the list. - $this->helperButtonHasLabel('edit-options-group-info-add-group', t('Add another item')); + $this->helperButtonHasLabel('edit-options-group-info-add-group', 'Add another item'); // Validate a single entry for a grouped filter. $this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type'); -- GitLab