diff --git a/core/modules/comment/tests/src/Functional/CommentStatusFieldAccessTest.php b/core/modules/comment/tests/src/Functional/CommentStatusFieldAccessTest.php index a558cda9389..9a34ac30387 100644 --- a/core/modules/comment/tests/src/Functional/CommentStatusFieldAccessTest.php +++ b/core/modules/comment/tests/src/Functional/CommentStatusFieldAccessTest.php @@ -88,16 +88,12 @@ class CommentStatusFieldAccessTest extends BrowserTestBase { $this->drupalGet('node/add/article'); $assert = $this->assertSession(); $assert->fieldNotExists('comment[0][status]'); - $this->submitForm([ - 'title[0][value]' => 'Node 1', - ], t('Save')); + $this->submitForm(['title[0][value]' => 'Node 1'], 'Save'); $assert->fieldExists('subject[0][value]'); $this->drupalLogin($this->commentAdmin); $this->drupalGet('node/add/article'); $assert->fieldExists('comment[0][status]'); - $this->submitForm([ - 'title[0][value]' => 'Node 2', - ], t('Save')); + $this->submitForm(['title[0][value]' => 'Node 2'], 'Save'); $assert->fieldExists('subject[0][value]'); } diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php b/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php index 592321f8a90..38da3557031 100644 --- a/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php +++ b/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php @@ -66,7 +66,7 @@ class ModerationFormTest extends ModerationStateTestBase { $this->assertSession()->optionNotExists('moderation_state[0][state]', 'archived'); // Create new moderated content in draft. - $this->submitForm(['moderation_state[0][state]' => 'draft'], t('Save')); + $this->submitForm(['moderation_state[0][state]' => 'draft'], 'Save'); $node = $this->drupalGetNodeByTitle('Some moderated content'); $canonical_path = sprintf('node/%d', $node->id()); diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationDisableSettingTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationDisableSettingTest.php index 69170c32b1c..037402c1f0a 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationDisableSettingTest.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationDisableSettingTest.php @@ -53,7 +53,7 @@ class ContentTranslationDisableSettingTest extends BrowserTestBase { $translatable_checkbox => TRUE, $language_alterable => TRUE, ]; - $this->submitForm($edit, t('Save configuration')); + $this->submitForm($edit, 'Save configuration'); $assert->pageTextContains(t('Settings successfully updated.')); @@ -64,7 +64,7 @@ class ContentTranslationDisableSettingTest extends BrowserTestBase { $translatable_checkbox => TRUE, $language_alterable => TRUE, ]; - $this->submitForm($edit, t('Save configuration')); + $this->submitForm($edit, 'Save configuration'); $assert->pageTextContains(t('Settings successfully updated.')); diff --git a/core/modules/inline_form_errors/tests/src/Functional/FormErrorHandlerFileUploadTest.php b/core/modules/inline_form_errors/tests/src/Functional/FormErrorHandlerFileUploadTest.php index 865f3e055ab..971ded2aa42 100644 --- a/core/modules/inline_form_errors/tests/src/Functional/FormErrorHandlerFileUploadTest.php +++ b/core/modules/inline_form_errors/tests/src/Functional/FormErrorHandlerFileUploadTest.php @@ -94,7 +94,7 @@ class FormErrorHandlerFileUploadTest extends BrowserTestBase { $edit = [ 'edit-title-0-value' => $this->randomString(), ]; - $this->submitForm($edit, t('Save')); + $this->submitForm($edit, 'Save'); $error_text = $this->getSession()->getPage()->find('css', '.field--name-field-ief-file .form-item--error-message')->getText(); diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/DoubleSlashTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/DoubleSlashTest.php index d1972b529ae..d17fc5336e2 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/DoubleSlashTest.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/DoubleSlashTest.php @@ -58,10 +58,10 @@ class DoubleSlashTest extends MigrateUpgradeExecuteTestBase { // Start the upgrade process. $this->drupalGet('/upgrade'); - $this->submitForm([], t('Continue')); - $this->submitForm($edits, t('Review upgrade')); - $this->submitForm([], t('I acknowledge I may lose data. Continue anyway.')); - $this->submitForm([], t('Perform upgrade')); + $this->submitForm([], 'Continue'); + $this->submitForm($edits, 'Review upgrade'); + $this->submitForm([], 'I acknowledge I may lose data. Continue anyway.'); + $this->submitForm([], 'Perform upgrade'); // Tests the migration log contains an error message. $migration = $this->getMigrationPluginManager()->createInstance('d7_file'); diff --git a/core/modules/user/tests/src/Functional/UserPasswordResetTest.php b/core/modules/user/tests/src/Functional/UserPasswordResetTest.php index dbb4554cf5b..0b91f2bb76d 100644 --- a/core/modules/user/tests/src/Functional/UserPasswordResetTest.php +++ b/core/modules/user/tests/src/Functional/UserPasswordResetTest.php @@ -262,7 +262,7 @@ class UserPasswordResetTest extends BrowserTestBase { // Test password reset with language prefixes. $this->drupalGet($visitingUrl); $edit = ['name' => $this->account->getAccountName()]; - $this->submitForm($edit, t('Submit')); + $this->submitForm($edit, 'Submit'); $this->assertValidPasswordReset($edit['name']); $resetURL = $this->getResetURL(); diff --git a/core/modules/views/tests/src/FunctionalJavascript/BlockExposedFilterAJAXTest.php b/core/modules/views/tests/src/FunctionalJavascript/BlockExposedFilterAJAXTest.php index 86d7b5adf91..8a8e8641067 100644 --- a/core/modules/views/tests/src/FunctionalJavascript/BlockExposedFilterAJAXTest.php +++ b/core/modules/views/tests/src/FunctionalJavascript/BlockExposedFilterAJAXTest.php @@ -63,7 +63,7 @@ class BlockExposedFilterAJAXTest extends WebDriverTestBase { $this->assertStringContainsString('Article A', $html); // Filter by page type. - $this->submitForm(['type' => 'page'], t('Apply')); + $this->submitForm(['type' => 'page'], 'Apply'); $this->assertSession()->waitForElementRemoved('xpath', '//*[text()="Article A"]'); // Verify that only the page nodes are present. @@ -73,7 +73,7 @@ class BlockExposedFilterAJAXTest extends WebDriverTestBase { $this->assertStringNotContainsString('Article A', $html); // Reset the form. - $this->submitForm([], t('Reset')); + $this->submitForm([], 'Reset'); // Assert we are still on the node page. $html = $page->getHtml(); // Repeat the original tests. @@ -87,9 +87,9 @@ class BlockExposedFilterAJAXTest extends WebDriverTestBase { // is redirected to the page display. $this->drupalPlaceBlock('views_block:test_block_exposed_ajax_with_page-block_1'); $this->drupalGet($node->toUrl()); - $this->submitForm(['type' => 'page'], t('Apply')); + $this->submitForm(['type' => 'page'], 'Apply'); $this->assertSession()->waitForElementRemoved('xpath', '//*[text()="Article A"]'); - $this->submitForm([], t('Reset')); + $this->submitForm([], 'Reset'); $this->assertSession()->addressEquals('some-path'); } diff --git a/core/modules/views/tests/src/FunctionalJavascript/ExposedFilterAJAXTest.php b/core/modules/views/tests/src/FunctionalJavascript/ExposedFilterAJAXTest.php index 25d4d907188..0cbfd937669 100644 --- a/core/modules/views/tests/src/FunctionalJavascript/ExposedFilterAJAXTest.php +++ b/core/modules/views/tests/src/FunctionalJavascript/ExposedFilterAJAXTest.php @@ -67,7 +67,7 @@ class ExposedFilterAJAXTest extends WebDriverTestBase { $this->assertStringContainsString('Page Two', $html); // Search for "Page One". - $this->submitForm(['title' => 'Page One'], t('Filter')); + $this->submitForm(['title' => 'Page One'], 'Filter'); $this->assertSession()->assertWaitOnAjaxRequest(); // Verify that only the "Page One" Node is present. @@ -76,7 +76,7 @@ class ExposedFilterAJAXTest extends WebDriverTestBase { $this->assertStringNotContainsString('Page Two', $html); // Search for "Page Two". - $this->submitForm(['title' => 'Page Two'], t('Filter')); + $this->submitForm(['title' => 'Page Two'], 'Filter'); $this->assertSession()->assertWaitOnAjaxRequest(); // Verify that only the "Page Two" Node is present. @@ -89,13 +89,13 @@ class ExposedFilterAJAXTest extends WebDriverTestBase { $this->submitForm([ 'action' => 'node_make_sticky_action', 'node_bulk_form[0]' => TRUE, - ], t('Apply to selected items')); + ], 'Apply to selected items'); // Verify that the action was performed. $this->assertSession()->pageTextContains('Make content sticky was applied to 1 item.'); // Reset the form. - $this->submitForm([], t('Reset')); + $this->submitForm([], 'Reset'); $this->assertSession()->assertWaitOnAjaxRequest(); $this->assertSession()->pageTextContains('Page One'); diff --git a/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php b/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php index df76829fadd..90d77e88497 100644 --- a/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php +++ b/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php @@ -228,7 +228,7 @@ class DemoUmamiProfileTest extends BrowserTestBase { $this->submitForm([ 'name' => $account->getAccountName(), 'pass' => $password, - ], t('Log in')); + ], 'Log in'); // @see ::drupalUserIsLoggedIn() $account->sessionId = $this->getSession()->getCookie(\Drupal::service('session_configuration')->getOptions(\Drupal::request())['name']); diff --git a/core/tests/Drupal/Tests/UiHelperTrait.php b/core/tests/Drupal/Tests/UiHelperTrait.php index d3bd6c35c7f..04ce159306a 100644 --- a/core/tests/Drupal/Tests/UiHelperTrait.php +++ b/core/tests/Drupal/Tests/UiHelperTrait.php @@ -254,7 +254,7 @@ trait UiHelperTrait { $this->submitForm([ 'name' => $account->getAccountName(), 'pass' => $account->passRaw, - ], t('Log in')); + ], 'Log in'); // @see ::drupalUserIsLoggedIn() $account->sessionId = $this->getSession()->getCookie(\Drupal::service('session_configuration')->getOptions(\Drupal::request())['name']);