Unverified Commit 2ebe9ce9 authored by alexpott's avatar alexpott

Issue #3153264 by siddhant.bhosale, Hardik_Patel_12, longwave: Remove uses of...

Issue #3153264 by siddhant.bhosale, Hardik_Patel_12, longwave: Remove uses of t() in clickViewsOperationLink(), helperButtonHasLabel() and optionExists() calls

(cherry picked from commit 7ad99c1e)
parent fc1f0184
...@@ -58,7 +58,7 @@ public function testSubmitButton() { ...@@ -58,7 +58,7 @@ public function testSubmitButton() {
// Test the submit button value defaults to 'Apply'. // Test the submit button value defaults to 'Apply'.
$this->drupalGet('test_exposed_form_buttons'); $this->drupalGet('test_exposed_form_buttons');
$this->assertSession()->statusCodeEquals(200); $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. // Rename the label of the submit button.
$view = Views::getView('test_exposed_form_buttons'); $view = Views::getView('test_exposed_form_buttons');
...@@ -84,7 +84,7 @@ public function testSubmitButton() { ...@@ -84,7 +84,7 @@ public function testSubmitButton() {
// Make sure the submit button label shows 'Apply'. // Make sure the submit button label shows 'Apply'.
$this->drupalGet('test_exposed_form_buttons'); $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');
} }
/** /**
...@@ -264,7 +264,7 @@ public function testInputRequired() { ...@@ -264,7 +264,7 @@ public function testInputRequired() {
$this->drupalGet('test_exposed_form_buttons'); $this->drupalGet('test_exposed_form_buttons');
$this->assertSession()->statusCodeEquals(200); $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. // Ensure that no results are displayed.
$rows = $this->xpath("//div[contains(@class, 'views-row')]"); $rows = $this->xpath("//div[contains(@class, 'views-row')]");
......
...@@ -47,7 +47,7 @@ public function testDefaultViews() { ...@@ -47,7 +47,7 @@ public function testDefaultViews() {
// Enable the view, and make sure it is now visible on the main listing // Enable the view, and make sure it is now visible on the main listing
// page. // page.
$this->drupalGet('admin/structure/views'); $this->drupalGet('admin/structure/views');
$this->clickViewsOperationLink(t('Enable'), '/glossary/'); $this->clickViewsOperationLink('Enable', '/glossary/');
$this->assertUrl('admin/structure/views'); $this->assertUrl('admin/structure/views');
$this->assertLinkByHref($edit_href); $this->assertLinkByHref($edit_href);
...@@ -76,7 +76,7 @@ public function testDefaultViews() { ...@@ -76,7 +76,7 @@ public function testDefaultViews() {
$this->drupalGet('admin/structure/views'); $this->drupalGet('admin/structure/views');
$this->assertLinkByHref('admin/structure/views/view/archive/enable'); $this->assertLinkByHref('admin/structure/views/view/archive/enable');
// Enable it again so it can be tested for access permissions. // 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 // It should now be possible to revert the view. Do that, and make sure the
// view title we added above no longer is displayed. // view title we added above no longer is displayed.
...@@ -89,7 +89,7 @@ public function testDefaultViews() { ...@@ -89,7 +89,7 @@ public function testDefaultViews() {
// Duplicate the view and check that the normal schema of duplicated views is used. // Duplicate the view and check that the normal schema of duplicated views is used.
$this->drupalGet('admin/structure/views'); $this->drupalGet('admin/structure/views');
$this->clickViewsOperationLink(t('Duplicate'), '/glossary'); $this->clickViewsOperationLink('Duplicate', '/glossary');
$edit = [ $edit = [
'id' => 'duplicate_of_glossary', 'id' => 'duplicate_of_glossary',
]; ];
...@@ -99,7 +99,7 @@ public function testDefaultViews() { ...@@ -99,7 +99,7 @@ public function testDefaultViews() {
// Duplicate a view and set a custom name. // Duplicate a view and set a custom name.
$this->drupalGet('admin/structure/views'); $this->drupalGet('admin/structure/views');
$this->clickViewsOperationLink(t('Duplicate'), '/glossary'); $this->clickViewsOperationLink('Duplicate', '/glossary');
$random_name = strtolower($this->randomMachineName()); $random_name = strtolower($this->randomMachineName());
$this->drupalPostForm(NULL, ['id' => $random_name], t('Duplicate')); $this->drupalPostForm(NULL, ['id' => $random_name], t('Duplicate'));
$this->assertUrl("admin/structure/views/view/$random_name", [], 'The custom view name got saved.'); $this->assertUrl("admin/structure/views/view/$random_name", [], 'The custom view name got saved.');
...@@ -109,13 +109,13 @@ public function testDefaultViews() { ...@@ -109,13 +109,13 @@ public function testDefaultViews() {
// listing page. // listing page.
// @todo Test this behavior with templates instead. // @todo Test this behavior with templates instead.
$this->drupalGet('admin/structure/views'); $this->drupalGet('admin/structure/views');
$this->clickViewsOperationLink(t('Disable'), '/glossary/'); $this->clickViewsOperationLink('Disable', '/glossary/');
// $this->assertUrl('admin/structure/views'); // $this->assertUrl('admin/structure/views');
// $this->assertNoLinkByHref($edit_href); // $this->assertNoLinkByHref($edit_href);
// The easiest way to verify it appears on the disabled views listing page // The easiest way to verify it appears on the disabled views listing page
// is to try to click the "enable" link from there again. // is to try to click the "enable" link from there again.
$this->drupalGet('admin/structure/views'); $this->drupalGet('admin/structure/views');
$this->clickViewsOperationLink(t('Enable'), '/glossary/'); $this->clickViewsOperationLink('Enable', '/glossary/');
$this->assertUrl('admin/structure/views'); $this->assertUrl('admin/structure/views');
$this->assertLinkByHref($edit_href); $this->assertLinkByHref($edit_href);
...@@ -132,7 +132,7 @@ public function testDefaultViews() { ...@@ -132,7 +132,7 @@ public function testDefaultViews() {
// Test deleting a view. // Test deleting a view.
$this->drupalLogin($this->fullAdminUser); $this->drupalLogin($this->fullAdminUser);
$this->drupalGet('admin/structure/views'); $this->drupalGet('admin/structure/views');
$this->clickViewsOperationLink(t('Delete'), '/glossary/'); $this->clickViewsOperationLink('Delete', '/glossary/');
// Submit the confirmation form. // Submit the confirmation form.
$this->drupalPostForm(NULL, [], t('Delete')); $this->drupalPostForm(NULL, [], t('Delete'));
// Ensure the view is no longer listed. // Ensure the view is no longer listed.
...@@ -145,7 +145,7 @@ public function testDefaultViews() { ...@@ -145,7 +145,7 @@ public function testDefaultViews() {
// Delete all duplicated Glossary views. // Delete all duplicated Glossary views.
$this->drupalGet('admin/structure/views'); $this->drupalGet('admin/structure/views');
$this->clickViewsOperationLink(t('Delete'), 'duplicate_of_glossary'); $this->clickViewsOperationLink('Delete', 'duplicate_of_glossary');
// Submit the confirmation form. // Submit the confirmation form.
$this->drupalPostForm(NULL, [], t('Delete')); $this->drupalPostForm(NULL, [], t('Delete'));
...@@ -153,7 +153,7 @@ public function testDefaultViews() { ...@@ -153,7 +153,7 @@ public function testDefaultViews() {
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(200);
$this->drupalGet('admin/structure/views'); $this->drupalGet('admin/structure/views');
$this->clickViewsOperationLink(t('Delete'), $random_name); $this->clickViewsOperationLink('Delete', $random_name);
// Submit the confirmation form. // Submit the confirmation form.
$this->drupalPostForm(NULL, [], t('Delete')); $this->drupalPostForm(NULL, [], t('Delete'));
$this->drupalGet('glossary'); $this->drupalGet('glossary');
...@@ -183,7 +183,7 @@ public function testSplitListing() { ...@@ -183,7 +183,7 @@ public function testSplitListing() {
$this->assertCount(1, $elements, 'A disabled view is found in the disabled views table.'); $this->assertCount(1, $elements, 'A disabled view is found in the disabled views table.');
// Enable the view. // Enable the view.
$this->clickViewsOperationLink(t('Enable'), '/test_view_status/'); $this->clickViewsOperationLink('Enable', '/test_view_status/');
$elements = $this->xpath($xpath, $arguments); $elements = $this->xpath($xpath, $arguments);
$this->assertCount(0, $elements, 'After enabling a view, it is not found in the disabled views table.'); $this->assertCount(0, $elements, 'After enabling a view, it is not found in the disabled views table.');
......
...@@ -69,7 +69,7 @@ public function testExposedAdminUi() { ...@@ -69,7 +69,7 @@ public function testExposedAdminUi() {
$this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type'); $this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type');
// Be sure that the button is called exposed. // 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 // The first time the filter UI is displayed, the operator and the
// value forms should be shown. // value forms should be shown.
...@@ -81,7 +81,7 @@ public function testExposedAdminUi() { ...@@ -81,7 +81,7 @@ public function testExposedAdminUi() {
// Click the Expose filter button. // Click the Expose filter button.
$this->drupalPostForm('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type', $edit, t('Expose filter')); $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. // 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. // After exposing the filter, Operator and Value should be still here.
$this->assertFieldById('edit-options-operator-in', 'in', 'Operator In exists'); $this->assertFieldById('edit-options-operator-in', 'in', 'Operator In exists');
...@@ -102,7 +102,7 @@ public function testExposedAdminUi() { ...@@ -102,7 +102,7 @@ public function testExposedAdminUi() {
// Now check the sort criteria. // Now check the sort criteria.
$this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/sort/created'); $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'); $this->assertNoFieldById('edit-options-expose-label', '', 'Make sure no label field is shown');
// Un-expose the filter. // Un-expose the filter.
...@@ -119,7 +119,7 @@ public function testExposedAdminUi() { ...@@ -119,7 +119,7 @@ public function testExposedAdminUi() {
$edit = []; $edit = [];
$this->drupalPostForm('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/sort/created', $edit, t('Expose sort')); $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. // 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'); $this->assertFieldById('edit-options-expose-label', 'Authored on', 'Make sure a label field is shown');
// Test adding a new exposed sort criteria. // Test adding a new exposed sort criteria.
...@@ -154,7 +154,7 @@ public function testGroupedFilterAdminUi() { ...@@ -154,7 +154,7 @@ public function testGroupedFilterAdminUi() {
// Click the Expose filter button. // Click the Expose filter button.
$this->drupalPostForm('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type', $edit, t('Expose filter')); $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. // 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. // Click the Grouped Filters button.
$this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type'); $this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type');
...@@ -169,7 +169,7 @@ public function testGroupedFilterAdminUi() { ...@@ -169,7 +169,7 @@ public function testGroupedFilterAdminUi() {
// Check that after click on 'Grouped Filters', a new button is shown to // Check that after click on 'Grouped Filters', a new button is shown to
// add more items to the list. // 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. // Validate a single entry for a grouped filter.
$this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type'); $this->drupalGet('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/filter/type');
......
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