Skip to content
Snippets Groups Projects
Unverified Commit b6c39ff6 authored by Alex Pott's avatar Alex Pott
Browse files

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 b928c0cf
No related branches found
No related tags found
No related merge requests found
......@@ -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');
}
/**
......@@ -264,7 +264,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')]");
......
......@@ -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.');
......
......@@ -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');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment