Hello World - FR
', 'format' => 'full_html', @@ -1118,7 +1118,7 @@ protected function setSiteInformation($site_name, $site_slogan) { 'site_name' => $site_name, 'site_slogan' => $site_slogan, ]; - $this->drupalPostForm('admin/config/system/site-information', $edit, t('Save configuration')); + $this->drupalPostForm('admin/config/system/site-information', $edit, 'Save configuration'); $this->assertRaw(t('The configuration options have been saved.')); } diff --git a/core/modules/contact/tests/src/Functional/ContactLanguageTest.php b/core/modules/contact/tests/src/Functional/ContactLanguageTest.php index a0690a84d514322ee819e4fc870d060afe685155..417e07d442611f3c299112b50e556d05ac3972cb 100644 --- a/core/modules/contact/tests/src/Functional/ContactLanguageTest.php +++ b/core/modules/contact/tests/src/Functional/ContactLanguageTest.php @@ -58,7 +58,7 @@ public function testContactLanguage() { $settings_path = 'admin/config/regional/content-language'; $edit['entity_types[contact_message]'] = TRUE; $edit['settings[contact_message][feedback][settings][language][language_alterable]'] = TRUE; - $this->drupalPostForm($settings_path, $edit, t('Save configuration')); + $this->drupalPostForm($settings_path, $edit, 'Save configuration'); // Ensure that contact form now shows the language select. $this->drupalGet('contact'); diff --git a/core/modules/contact/tests/src/Functional/ContactPersonalTest.php b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php index e8abc2601dfb58d8f91aeb578d734146c451b7cc..2cea31d68b1f8aa738d6937bc7c76f2d2977fc42 100644 --- a/core/modules/contact/tests/src/Functional/ContactPersonalTest.php +++ b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php @@ -202,7 +202,7 @@ public function testPersonalContactAccess() { // Disable the personal contact form. $this->drupalLogin($this->adminUser); $edit = ['contact_default_status' => FALSE]; - $this->drupalPostForm('admin/config/people/accounts', $edit, t('Save configuration')); + $this->drupalPostForm('admin/config/people/accounts', $edit, 'Save configuration'); $this->assertText('The configuration options have been saved.', 'Setting successfully saved.'); $this->drupalLogout(); @@ -239,7 +239,7 @@ public function testPersonalContactAccess() { $this->drupalGet('user/' . $this->webUser->id() . '/edit'); $this->assertSession()->checkboxNotChecked('edit-contact--2'); $this->assertNull(\Drupal::service('user.data')->get('contact', $this->webUser->id(), 'enabled'), 'Personal contact form disabled'); - $this->drupalPostForm(NULL, ['contact' => TRUE], t('Save')); + $this->drupalPostForm(NULL, ['contact' => TRUE], 'Save'); $this->assertSession()->checkboxChecked('edit-contact--2'); $this->assertNotEmpty(\Drupal::service('user.data')->get('contact', $this->webUser->id(), 'enabled'), 'Personal contact form enabled'); @@ -320,7 +320,7 @@ protected function checkContactAccess($response, $contact_value = NULL) { if (isset($contact_value)) { $edit['contact'] = $contact_value; } - $this->drupalPostForm('admin/people/create', $edit, t('Create new account')); + $this->drupalPostForm('admin/people/create', $edit, 'Create new account'); $user = user_load_by_name($name); $this->drupalLogout(); @@ -345,7 +345,7 @@ protected function submitPersonalContact(AccountInterface $account, array $messa 'subject[0][value]' => $this->randomMachineName(16) . '< " =+ >', 'message[0][value]' => $this->randomMachineName(64) . '< " =+ >', ]; - $this->drupalPostForm('user/' . $account->id() . '/contact', $message, t('Send message')); + $this->drupalPostForm('user/' . $account->id() . '/contact', $message, 'Send message'); return $message; } diff --git a/core/modules/contact/tests/src/Functional/ContactSitewideTest.php b/core/modules/contact/tests/src/Functional/ContactSitewideTest.php index 394ca7ed0706d6281e8406968f224f11924fc320..06c548cb30663e918155ce83112ee01658ca97e0 100644 --- a/core/modules/contact/tests/src/Functional/ContactSitewideTest.php +++ b/core/modules/contact/tests/src/Functional/ContactSitewideTest.php @@ -106,7 +106,7 @@ public function testSiteWideContact() { // Set settings. $edit = []; $edit['contact_default_status'] = TRUE; - $this->drupalPostForm('admin/config/people/accounts', $edit, t('Save configuration')); + $this->drupalPostForm('admin/config/people/accounts', $edit, 'Save configuration'); $this->assertText('The configuration options have been saved.'); $this->drupalGet('admin/structure/contact'); @@ -333,7 +333,7 @@ public function testSiteWideContact() { 'message[0][value]' => $this->randomMachineName(), $field_name . '[0][value]' => $this->randomMachineName(), ]; - $this->drupalPostForm(NULL, $edit, t('Send message')); + $this->drupalPostForm(NULL, $edit, 'Send message'); $mails = $this->getMails(); $mail = array_pop($mails); $this->assertEqual($mail['subject'], t('[@label] @subject', ['@label' => $label, '@subject' => $edit['subject[0][value]']])); @@ -355,7 +355,7 @@ public function testSiteWideContact() { 'message[0][value]' => $this->randomMachineName(), $field_name . '[0][value]' => $this->randomMachineName(), ]; - $this->drupalPostForm(NULL, $edit, t('Send message')); + $this->drupalPostForm(NULL, $edit, 'Send message'); $this->assertText('Thanks for your submission.'); $this->assertSession()->addressEquals('user/' . $admin_user->id()); @@ -375,7 +375,7 @@ public function testSiteWideContact() { 'message[0][value]' => $this->randomMachineName(), $field_name . '[0][value]' => $this->randomMachineName(), ]; - $this->drupalPostForm(NULL, $edit, t('Send message')); + $this->drupalPostForm(NULL, $edit, 'Send message'); $result = $this->xpath('//div[@role=:role]', [':role' => 'contentinfo']); $this->assertCount(0, $result, 'Messages not found.'); $this->assertSession()->addressEquals('user/' . $admin_user->id()); @@ -387,7 +387,7 @@ public function testSiteWideContact() { 'message[0][value]' => $this->randomMachineName(), $field_name . '[0][value]' => $this->randomMachineName(), ]; - $this->drupalPostForm($form->toUrl('canonical'), $edit, t('Preview')); + $this->drupalPostForm($form->toUrl('canonical'), $edit, 'Preview'); // Message is now by default displayed twice, once for the form element and // once for the viewed message. @@ -400,9 +400,9 @@ public function testSiteWideContact() { $display_edit = [ 'fields[message][label]' => 'hidden', ]; - $this->drupalPostForm('admin/structure/contact/manage/' . $contact_form . '/display', $display_edit, t('Save')); + $this->drupalPostForm('admin/structure/contact/manage/' . $contact_form . '/display', $display_edit, 'Save'); - $this->drupalPostForm($form->toUrl('canonical'), $edit, t('Preview')); + $this->drupalPostForm($form->toUrl('canonical'), $edit, 'Preview'); // Message should only be displayed once now. $page_text = $this->getSession()->getPage()->getText(); $this->assertEquals(1, substr_count($page_text, t('Message'))); @@ -505,7 +505,7 @@ public function addContactForm($id, $label, $recipients, $reply, $selected, $mes $edit['reply'] = $reply; $edit['selected'] = ($selected ? TRUE : FALSE); $edit += $third_party_settings; - $this->drupalPostForm('admin/structure/contact/add', $edit, t('Save')); + $this->drupalPostForm('admin/structure/contact/add', $edit, 'Save'); } /** @@ -536,7 +536,7 @@ public function updateContactForm($id, $label, $recipients, $reply, $selected, $ $edit['selected'] = ($selected ? TRUE : FALSE); $edit['message'] = $message; $edit['redirect'] = $redirect; - $this->drupalPostForm("admin/structure/contact/manage/$id", $edit, t('Save')); + $this->drupalPostForm("admin/structure/contact/manage/$id", $edit, 'Save'); } /** @@ -560,10 +560,10 @@ public function submitContact($name, $mail, $subject, $id, $message) { $edit['subject[0][value]'] = $subject; $edit['message[0][value]'] = $message; if ($id == $this->config('contact.settings')->get('default_form')) { - $this->drupalPostForm('contact', $edit, t('Send message')); + $this->drupalPostForm('contact', $edit, 'Send message'); } else { - $this->drupalPostForm('contact/' . $id, $edit, t('Send message')); + $this->drupalPostForm('contact/' . $id, $edit, 'Send message'); } } @@ -579,7 +579,7 @@ public function deleteContactForms() { $this->assertSession()->statusCodeEquals(403); } else { - $this->drupalPostForm("admin/structure/contact/manage/$id/delete", [], t('Delete')); + $this->drupalPostForm("admin/structure/contact/manage/$id/delete", [], 'Delete'); $this->assertRaw(t('The contact form %label has been deleted.', ['%label' => $contact_form->label()])); $this->assertNull(ContactForm::load($id), new FormattableMarkup('Form %contact_form not found', ['%contact_form' => $contact_form->label()])); } diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php b/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php index 4e57a16624cf61fcc13c588ef26bd4bfe4ed00d0..10707a7931e47ef27b0904ea7aba027fb68cf2df 100644 --- a/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php +++ b/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php @@ -90,7 +90,7 @@ public function testModerationForm() { $this->drupalPostForm($edit_path, [ 'body[0][value]' => 'Second version of the content.', 'moderation_state[0][state]' => 'draft', - ], t('Save')); + ], 'Save'); // The canonical view should have a moderation form, because it is not the // live revision. @@ -102,7 +102,7 @@ public function testModerationForm() { $this->drupalPostForm($edit_path, [ 'body[0][value]' => 'Second version of the content.', 'moderation_state[0][state]' => 'draft', - ], t('Preview')); + ], 'Preview'); // The preview view should not have a moderation form. $preview_url = Url::fromRoute('entity.node.preview', [ @@ -122,7 +122,7 @@ public function testModerationForm() { $this->drupalPostForm($edit_path, [ 'body[0][value]' => 'Third version of the content.', 'moderation_state[0][state]' => 'published', - ], t('Save')); + ], 'Save'); // Check widget default value. $this->drupalGet($edit_path); @@ -152,7 +152,7 @@ public function testModerationForm() { $this->drupalPostForm($edit_path, [ 'body[0][value]' => 'Fourth version of the content.', 'moderation_state[0][state]' => 'draft', - ], t('Save')); + ], 'Save'); // The published view should not have a moderation form, because it is the // live revision. @@ -170,7 +170,7 @@ public function testModerationForm() { // Submit the moderation form to change status to published. $this->drupalPostForm($latest_version_path, [ 'new_state' => 'published', - ], t('Apply')); + ], 'Apply'); // The latest version page should not show, because there is no // pending revision. @@ -187,7 +187,7 @@ public function testNonBundleModerationForm() { $this->workflow->save(); // Create new moderated content in draft. - $this->drupalPostForm('entity_test_mulrevpub/add', ['moderation_state[0][state]' => 'draft'], t('Save')); + $this->drupalPostForm('entity_test_mulrevpub/add', ['moderation_state[0][state]' => 'draft'], 'Save'); // The latest version page should not show, because there is no pending // revision. @@ -195,7 +195,7 @@ public function testNonBundleModerationForm() { $this->assertSession()->statusCodeEquals(403); // Update the draft. - $this->drupalPostForm('entity_test_mulrevpub/manage/1/edit', ['moderation_state[0][state]' => 'draft'], t('Save')); + $this->drupalPostForm('entity_test_mulrevpub/manage/1/edit', ['moderation_state[0][state]' => 'draft'], 'Save'); // The latest version page should not show, because there is still no // pending revision. @@ -203,7 +203,7 @@ public function testNonBundleModerationForm() { $this->assertSession()->statusCodeEquals(403); // Publish the draft. - $this->drupalPostForm('entity_test_mulrevpub/manage/1/edit', ['moderation_state[0][state]' => 'published'], t('Save')); + $this->drupalPostForm('entity_test_mulrevpub/manage/1/edit', ['moderation_state[0][state]' => 'published'], 'Save'); // The published view should not have a moderation form, because it is the // default revision. @@ -217,7 +217,7 @@ public function testNonBundleModerationForm() { $this->assertSession()->statusCodeEquals(403); // Make a pending revision. - $this->drupalPostForm('entity_test_mulrevpub/manage/1/edit', ['moderation_state[0][state]' => 'draft'], t('Save')); + $this->drupalPostForm('entity_test_mulrevpub/manage/1/edit', ['moderation_state[0][state]' => 'draft'], 'Save'); // The published view should not have a moderation form, because it is the // default revision. @@ -235,7 +235,7 @@ public function testNonBundleModerationForm() { // Submit the moderation form to change status to published. $this->drupalPostForm('entity_test_mulrevpub/manage/1/latest', [ 'new_state' => 'published', - ], t('Apply')); + ], 'Apply'); // The latest version page should not show, because there is no // pending revision. @@ -260,7 +260,7 @@ public function testModerationFormSetsRevisionAuthor() { $this->drupalLogin($another_user); $this->drupalPostForm(sprintf('node/%d/latest', $node->id()), [ 'new_state' => 'published', - ], t('Apply')); + ], 'Apply'); $this->drupalGet(sprintf('node/%d/revisions', $node->id())); $this->assertText('by ' . $another_user->getAccountName()); @@ -280,7 +280,7 @@ public function testContentTranslationNodeForm() { $edit = [ 'predefined_langcode' => 'fr', ]; - $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language')); + $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language'); // Enable content translation on articles. $this->drupalGet('admin/config/regional/content-language'); @@ -289,7 +289,7 @@ public function testContentTranslationNodeForm() { 'settings[node][moderated_content][translatable]' => TRUE, 'settings[node][moderated_content][settings][language][language_alterable]' => TRUE, ]; - $this->drupalPostForm(NULL, $edit, t('Save configuration')); + $this->drupalPostForm(NULL, $edit, 'Save configuration'); // Adding languages requires a container rebuild in the test running // environment so that multilingual services are used. @@ -300,7 +300,7 @@ public function testContentTranslationNodeForm() { 'title[0][value]' => 'Some moderated content', 'body[0][value]' => 'First version of the content.', 'moderation_state[0][state]' => 'draft', - ], t('Save')); + ], 'Save'); $this->assertNotEmpty($this->xpath('//ul[@class="entity-moderation-form"]')); $node = $this->drupalGetNodeByTitle('Some moderated content'); @@ -322,7 +322,7 @@ public function testContentTranslationNodeForm() { $this->drupalPostForm(NULL, [ 'body[0][value]' => 'Second version of the content.', 'moderation_state[0][state]' => 'published', - ], t('Save (this translation)')); + ], 'Save (this translation)'); $this->drupalGet($latest_version_path, ['language' => $french]); $this->assertSession()->statusCodeEquals('403'); @@ -346,7 +346,7 @@ public function testContentTranslationNodeForm() { $this->drupalPostForm(NULL, [ 'body[0][value]' => 'Third version of the content.', 'moderation_state[0][state]' => 'draft', - ], t('Save (this translation)')); + ], 'Save (this translation)'); $this->drupalGet($latest_version_path, ['language' => $french]); $this->assertNotEmpty($this->xpath('//ul[@class="entity-moderation-form"]')); @@ -366,7 +366,7 @@ public function testContentTranslationNodeForm() { $this->drupalPostForm(NULL, [ 'body[0][value]' => 'Fifth version of the content.', 'moderation_state[0][state]' => 'published', - ], t('Save (this translation)')); + ], 'Save (this translation)'); $this->drupalGet($latest_version_path, ['language' => $french]); $this->assertEmpty($this->xpath('//ul[@class="entity-moderation-form"]')); @@ -379,7 +379,7 @@ public function testContentTranslationNodeForm() { $this->drupalPostForm(NULL, [ 'body[0][value]' => 'Sixth version of the content.', 'moderation_state[0][state]' => 'published', - ], t('Save (this translation)')); + ], 'Save (this translation)'); $this->drupalGet($latest_version_path); $this->assertEmpty($this->xpath('//ul[@class="entity-moderation-form"]')); @@ -398,7 +398,7 @@ public function testContentTranslationNodeForm() { $this->drupalPostForm(NULL, [ 'body[0][value]' => 'Seventh version of the content.', 'moderation_state[0][state]' => 'draft', - ], t('Save (this translation)')); + ], 'Save (this translation)'); $this->drupalGet($latest_version_path); $this->assertNotEmpty($this->xpath('//ul[@class="entity-moderation-form"]')); @@ -413,7 +413,7 @@ public function testContentTranslationNodeForm() { $this->drupalPostForm(NULL, [ 'body[0][value]' => 'Eighth version of the content.', 'moderation_state[0][state]' => 'published', - ], t('Save (this translation)')); + ], 'Save (this translation)'); $this->drupalGet($latest_version_path); $this->assertEmpty($this->xpath('//ul[@class="entity-moderation-form"]')); @@ -434,7 +434,7 @@ public function testContentTranslationNodeForm() { $this->drupalPostForm('node/add/moderated_content', [ 'title[0][value]' => 'Third moderated content', 'moderation_state[0][state]' => 'published', - ], t('Save')); + ], 'Save'); $node = $this->drupalGetNodeByTitle('Third moderated content'); $this->assertNotEmpty($node->language(), 'en'); @@ -448,7 +448,7 @@ public function testContentTranslationNodeForm() { $this->assertSession()->optionExists('moderation_state[0][state]', 'archived'); $this->drupalPostForm(NULL, [ 'moderation_state[0][state]' => 'draft', - ], t('Save (this translation)')); + ], 'Save (this translation)'); // Add another draft for the translation (revision 3). $this->drupalGet($edit_path, ['language' => $french]); @@ -457,7 +457,7 @@ public function testContentTranslationNodeForm() { $this->assertSession()->optionNotExists('moderation_state[0][state]', 'archived'); $this->drupalPostForm(NULL, [ 'moderation_state[0][state]' => 'draft', - ], t('Save (this translation)')); + ], 'Save (this translation)'); // Updating and publishing the french translation is still possible. $this->drupalGet($edit_path, ['language' => $french]); @@ -466,7 +466,7 @@ public function testContentTranslationNodeForm() { $this->assertSession()->optionNotExists('moderation_state[0][state]', 'archived'); $this->drupalPostForm(NULL, [ 'moderation_state[0][state]' => 'published', - ], t('Save (this translation)')); + ], 'Save (this translation)'); // Now the french translation is published, an english draft can be added. $this->drupalGet($edit_path); @@ -475,7 +475,7 @@ public function testContentTranslationNodeForm() { $this->assertSession()->optionExists('moderation_state[0][state]', 'archived'); $this->drupalPostForm(NULL, [ 'moderation_state[0][state]' => 'draft', - ], t('Save (this translation)')); + ], 'Save (this translation)'); } /** diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php b/core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php index 00566a8039adf2b6e328198df6a89e3fb1db6483..adc787b9bcb311d47e9f9e1e1dead0fe4389d74b 100644 --- a/core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php +++ b/core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php @@ -44,7 +44,7 @@ protected function setUp(): void { $edit = [ 'predefined_langcode' => $langcode, ]; - $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language')); + $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language'); } // Enable content translation on articles. @@ -54,7 +54,7 @@ protected function setUp(): void { 'settings[node][article][translatable]' => TRUE, 'settings[node][article][settings][language][language_alterable]' => TRUE, ]; - $this->drupalPostForm(NULL, $edit, t('Save configuration')); + $this->drupalPostForm(NULL, $edit, 'Save configuration'); // Adding languages requires a container rebuild in the test running // environment so that multilingual services are used. @@ -71,7 +71,7 @@ public function testTranslateModeratedContent() { 'langcode[0][value]' => 'en', 'moderation_state[0][state]' => 'published', ]; - $this->drupalPostForm('node/add/article', $edit, t('Save')); + $this->drupalPostForm('node/add/article', $edit, 'Save'); $this->assertText('Article Published English node has been created.'); $english_node = $this->drupalGetNodeByTitle('Published English node'); @@ -82,7 +82,7 @@ public function testTranslateModeratedContent() { 'title[0][value]' => 'French node Draft', 'moderation_state[0][state]' => 'draft', ]; - $this->drupalPostForm(NULL, $edit, t('Save (this translation)')); + $this->drupalPostForm(NULL, $edit, 'Save (this translation)'); // Here the error has occurred "The website encountered an unexpected error. // Please try again later." // If the translation has got lost. @@ -94,7 +94,7 @@ public function testTranslateModeratedContent() { 'langcode[0][value]' => 'en', 'moderation_state[0][state]' => 'draft', ]; - $this->drupalPostForm('node/add/article', $edit, t('Save')); + $this->drupalPostForm('node/add/article', $edit, 'Save'); $this->assertText('Article English node has been created.'); $english_node = $this->drupalGetNodeByTitle('English node'); @@ -105,7 +105,7 @@ public function testTranslateModeratedContent() { 'title[0][value]' => 'French node', 'moderation_state[0][state]' => 'draft', ]; - $this->drupalPostForm(NULL, $edit, t('Save (this translation)')); + $this->drupalPostForm(NULL, $edit, 'Save (this translation)'); $this->assertText('Article French node has been updated.'); $english_node = $this->drupalGetNodeByTitle('English node', TRUE); @@ -113,7 +113,7 @@ public function testTranslateModeratedContent() { // unpublished. $this->drupalPostForm('node/' . $english_node->id() . '/edit', [ 'moderation_state[0][state]' => 'published', - ], t('Save (this translation)')); + ], 'Save (this translation)'); $this->assertText('Article English node has been updated.'); $english_node = $this->drupalGetNodeByTitle('English node', TRUE); $french_node = $english_node->getTranslation('fr'); @@ -130,7 +130,7 @@ public function testTranslateModeratedContent() { 'title[0][value]' => 'Another node', 'moderation_state[0][state]' => 'draft', ]; - $this->drupalPostForm('node/add/article', $edit, t('Save')); + $this->drupalPostForm('node/add/article', $edit, 'Save'); $this->assertText('Article Another node has been created.'); $english_node = $this->drupalGetNodeByTitle('Another node'); @@ -141,7 +141,7 @@ public function testTranslateModeratedContent() { 'title[0][value]' => 'Translated node', 'moderation_state[0][state]' => 'draft', ]; - $this->drupalPostForm(NULL, $edit, t('Save (this translation)')); + $this->drupalPostForm(NULL, $edit, 'Save (this translation)'); $this->assertText('Article Translated node has been updated.'); $english_node = $this->drupalGetNodeByTitle('Another node', TRUE); @@ -149,7 +149,7 @@ public function testTranslateModeratedContent() { // unpublished. $this->drupalPostForm('fr/node/' . $english_node->id() . '/edit', [ 'moderation_state[0][state]' => 'published', - ], t('Save (this translation)')); + ], 'Save (this translation)'); $this->assertText('Article Translated node has been updated.'); $english_node = $this->drupalGetNodeByTitle('Another node', TRUE); $french_node = $english_node->getTranslation('fr'); @@ -163,7 +163,7 @@ public function testTranslateModeratedContent() { 'title[0][value]' => 'New draft of translated node', 'moderation_state[0][state]' => 'draft', ]; - $this->drupalPostForm('fr/node/' . $english_node->id() . '/edit', $edit, t('Save (this translation)')); + $this->drupalPostForm('fr/node/' . $english_node->id() . '/edit', $edit, 'Save (this translation)'); $this->assertText('Article New draft of translated node has been updated.'); $english_node = $this->drupalGetNodeByTitle('Another node', TRUE); $french_node = $english_node->getTranslation('fr'); @@ -174,7 +174,7 @@ public function testTranslateModeratedContent() { // Publish the French article before testing the archive transition. $this->drupalPostForm('fr/node/' . $english_node->id() . '/edit', [ 'moderation_state[0][state]' => 'published', - ], t('Save (this translation)')); + ], 'Save (this translation)'); $this->assertText('Article New draft of translated node has been updated.'); $english_node = $this->drupalGetNodeByTitle('Another node', TRUE); $french_node = $english_node->getTranslation('fr'); @@ -185,7 +185,7 @@ public function testTranslateModeratedContent() { // Publish the English article before testing the archive transition. $this->drupalPostForm('node/' . $english_node->id() . '/edit', [ 'moderation_state[0][state]' => 'published', - ], t('Save (this translation)')); + ], 'Save (this translation)'); $this->assertText('Article Another node has been updated.'); $english_node = $this->drupalGetNodeByTitle('Another node', TRUE); $this->assertEqual($english_node->moderation_state->value, 'published'); @@ -193,11 +193,11 @@ public function testTranslateModeratedContent() { // Archive the node and its translation. $this->drupalPostForm('node/' . $english_node->id() . '/edit', [ 'moderation_state[0][state]' => 'archived', - ], t('Save (this translation)')); + ], 'Save (this translation)'); $this->assertText('Article Another node has been updated.'); $this->drupalPostForm('fr/node/' . $english_node->id() . '/edit', [ 'moderation_state[0][state]' => 'archived', - ], t('Save (this translation)')); + ], 'Save (this translation)'); $this->assertText('Article New draft of translated node has been updated.'); $english_node = $this->drupalGetNodeByTitle('Another node', TRUE); $french_node = $english_node->getTranslation('fr'); @@ -466,7 +466,7 @@ protected function submitNodeForm($title, $moderation_state, $default_translatio $default_translation = TRUE; $edit['langcode[0][value]'] = $langcode; } - $submit = $default_translation ? t('Save') : t('Save (this translation)'); + $submit = $default_translation ? 'Save' : 'Save (this translation)'; $this->drupalPostForm(NULL, $edit, $submit); $message = $is_new ? "Article $title has been created." : "Article $title has been updated."; $this->assertSession()->pageTextContains($message); diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationRevisionRevertTest.php b/core/modules/content_moderation/tests/src/Functional/ModerationRevisionRevertTest.php index 217df4cdb53b2ba5b89f1916d81eb81940a5e86d..dff3847ea0c94ca6890e90e44d10240caa5e9a02 100644 --- a/core/modules/content_moderation/tests/src/Functional/ModerationRevisionRevertTest.php +++ b/core/modules/content_moderation/tests/src/Functional/ModerationRevisionRevertTest.php @@ -67,13 +67,13 @@ public function testEditingAfterRevertRevision() { $this->drupalPostForm('node/add/moderated_bundle', [ 'title[0][value]' => 'First draft node', 'moderation_state[0][state]' => 'draft', - ], t('Save')); + ], 'Save'); // Now make it published. $this->drupalPostForm('node/1/edit', [ 'title[0][value]' => 'Published node', 'moderation_state[0][state]' => 'published', - ], t('Save')); + ], 'Save'); // Check the editing form that show the published title. $this->drupalGet('node/1/edit'); @@ -93,7 +93,7 @@ public function testEditingAfterRevertRevision() { // Try to save the node. $this->drupalPostForm('node/1/edit', [ 'moderation_state[0][state]' => 'draft', - ], t('Save')); + ], 'Save'); // Check if the submission passed the EntityChangedConstraintValidator. $this->assertSession() diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationStateBlockTest.php b/core/modules/content_moderation/tests/src/Functional/ModerationStateBlockTest.php index 2296f73be6c3e6a4b9831c4853cb1f9a275c6b70..a2062ebc94927bdd6ed41eab416f87b7d283a1e4 100644 --- a/core/modules/content_moderation/tests/src/Functional/ModerationStateBlockTest.php +++ b/core/modules/content_moderation/tests/src/Functional/ModerationStateBlockTest.php @@ -58,7 +58,7 @@ public function testCustomBlockModeration() { // Enable moderation for custom blocks. $edit['bundles[basic]'] = TRUE; - $this->drupalPostForm('admin/config/workflow/workflows/manage/editorial/type/block_content', $edit, t('Save')); + $this->drupalPostForm('admin/config/workflow/workflows/manage/editorial/type/block_content', $edit, 'Save'); // Create a custom block at block/add and save it as draft. $body = 'Body of moderated block'; @@ -67,7 +67,7 @@ public function testCustomBlockModeration() { 'moderation_state[0][state]' => 'draft', 'body[0][value]' => $body, ]; - $this->drupalPostForm('block/add', $edit, t('Save')); + $this->drupalPostForm('block/add', $edit, 'Save'); $this->assertText('basic Moderated block has been created.'); // Place the block in the Sidebar First region. @@ -78,7 +78,7 @@ public function testCustomBlockModeration() { ]; $block = BlockContent::load(1); $url = 'admin/structure/block/add/block_content:' . $block->uuid() . '/' . $this->config('system.theme')->get('default'); - $this->drupalPostForm($url, $instance, t('Save block')); + $this->drupalPostForm($url, $instance, 'Save block'); // Navigate to home page and check that the block is visible. It should be // visible because it is the default revision. @@ -91,7 +91,7 @@ public function testCustomBlockModeration() { 'body[0][value]' => $updated_body, 'moderation_state[0][state]' => 'draft', ]; - $this->drupalPostForm('block/' . $block->id(), $edit, t('Save')); + $this->drupalPostForm('block/' . $block->id(), $edit, 'Save'); $this->assertText('basic Moderated block has been updated.'); // Navigate to the home page and check that the block shows the updated @@ -103,7 +103,7 @@ public function testCustomBlockModeration() { // Publish the block so we can create a pending revision. $this->drupalPostForm('block/' . $block->id(), [ 'moderation_state[0][state]' => 'published', - ], t('Save')); + ], 'Save'); // Create a pending revision. $pending_revision_body = 'This is the pending revision body value'; @@ -111,7 +111,7 @@ public function testCustomBlockModeration() { 'body[0][value]' => $pending_revision_body, 'moderation_state[0][state]' => 'draft', ]; - $this->drupalPostForm('block/' . $block->id(), $edit, t('Save')); + $this->drupalPostForm('block/' . $block->id(), $edit, 'Save'); $this->assertText('basic Moderated block has been updated.'); // Navigate to home page and check that the pending revision doesn't show, @@ -123,7 +123,7 @@ public function testCustomBlockModeration() { $edit = [ 'new_state' => 'published', ]; - $this->drupalPostForm('block/' . $block->id() . '/latest', $edit, t('Apply')); + $this->drupalPostForm('block/' . $block->id() . '/latest', $edit, 'Apply'); $this->assertText('The moderation state has been updated.'); // Navigate to home page and check that the pending revision is now the diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTest.php b/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTest.php index 8044b01a65189a1e997912a9975515f66ff26097..21b042f1f61ea09103cb5e63f2919dd15d83c916 100644 --- a/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTest.php +++ b/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTest.php @@ -34,7 +34,7 @@ public function testCreatingContent() { $this->drupalPostForm('node/add/moderated_content', [ 'title[0][value]' => 'moderated content', 'moderation_state[0][state]' => 'draft', - ], t('Save')); + ], 'Save'); $node = $this->getNodeByTitle('moderated content'); if (!$node) { $this->fail('Test node was not saved correctly.'); @@ -45,7 +45,7 @@ public function testCreatingContent() { // Set up published revision. $this->drupalPostForm($path, [ 'moderation_state[0][state]' => 'published', - ], t('Save')); + ], 'Save'); \Drupal::entityTypeManager()->getStorage('node')->resetCache([$node->id()]); /* @var \Drupal\node\NodeInterface $node */ $node = \Drupal::entityTypeManager()->getStorage('node')->load($node->id()); @@ -56,12 +56,12 @@ public function testCreatingContent() { $this->assertNoText('Published'); // Delete the node. - $this->drupalPostForm('node/' . $node->id() . '/delete', [], t('Delete')); + $this->drupalPostForm('node/' . $node->id() . '/delete', [], 'Delete'); $this->assertText('The Moderated content moderated content has been deleted.'); // Disable content moderation. $edit['bundles[moderated_content]'] = FALSE; - $this->drupalPostForm('admin/config/workflow/workflows/manage/editorial/type/node', $edit, t('Save')); + $this->drupalPostForm('admin/config/workflow/workflows/manage/editorial/type/node', $edit, 'Save'); // Ensure the parent environment is up-to-date. // @see content_moderation_workflow_insert() \Drupal::service('entity_type.bundle.info')->clearCachedBundles(); @@ -70,7 +70,7 @@ public function testCreatingContent() { // Create a new node. $this->drupalPostForm('node/add/moderated_content', [ 'title[0][value]' => 'non-moderated content', - ], t('Save')); + ], 'Save'); $node = $this->getNodeByTitle('non-moderated content'); if (!$node) { @@ -88,7 +88,7 @@ public function testFormSaveDestination() { 'title[0][value]' => 'Some moderated content', 'body[0][value]' => 'First version of the content.', 'moderation_state[0][state]' => 'draft', - ], t('Save')); + ], 'Save'); $node = $this->drupalGetNodeByTitle('Some moderated content'); $edit_path = sprintf('node/%d/edit', $node->id()); @@ -103,7 +103,7 @@ public function testFormSaveDestination() { $this->drupalPostForm($edit_path, [ 'body[0][value]' => 'Second version of the content.', 'moderation_state[0][state]' => 'draft', - ], t('Save')); + ], 'Save'); $this->assertSession()->addressEquals(Url::fromRoute('entity.node.canonical', ['node' => $node->id()])); $this->assertText('Second version of the content.'); @@ -112,7 +112,7 @@ public function testFormSaveDestination() { $this->drupalPostForm($edit_path, [ 'body[0][value]' => 'Third version of the content.', 'moderation_state[0][state]' => 'published', - ], t('Save')); + ], 'Save'); $this->assertSession()->addressEquals(Url::fromRoute('entity.node.canonical', ['node' => $node->id()])); $this->assertText('Third version of the content.'); @@ -121,7 +121,7 @@ public function testFormSaveDestination() { $this->drupalPostForm($edit_path, [ 'body[0][value]' => 'Fourth version of the content.', 'moderation_state[0][state]' => 'draft', - ], t('Save')); + ], 'Save'); $this->assertSession()->addressEquals(Url::fromRoute('entity.node.latest_version', ['node' => $node->id()])); $this->assertText('Fourth version of the content.'); } diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTypeTest.php b/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTypeTest.php index 44c714dd7db3b2211cf674ecd98f677ceb03e219..247f78a4b98d25040ae99dfb4ea1ef03019cc636 100644 --- a/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTypeTest.php +++ b/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTypeTest.php @@ -29,7 +29,7 @@ public function testNotModerated() { $this->assertRaw('Save'); $this->drupalPostForm(NULL, [ 'title[0][value]' => 'Test', - ], t('Save')); + ], 'Save'); $this->assertText('Not moderated Test has been created.'); } @@ -64,7 +64,7 @@ public function testEnablingOnExistingContent() { $this->drupalGet('node/add/not_moderated'); $this->drupalPostForm(NULL, [ 'title[0][value]' => 'Test', - ], t('Save')); + ], 'Save'); $this->assertText('Not moderated Test has been created.'); // Check that the 'Create new revision' is not disabled. diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationStateTestBase.php b/core/modules/content_moderation/tests/src/Functional/ModerationStateTestBase.php index 82562d94aa07a26fc27faf3d2faf2ec7581fcb3f..27ede210373203605a4c74af627bb11b12a00463 100644 --- a/core/modules/content_moderation/tests/src/Functional/ModerationStateTestBase.php +++ b/core/modules/content_moderation/tests/src/Functional/ModerationStateTestBase.php @@ -116,7 +116,7 @@ protected function createContentTypeFromUi($content_type_name, $content_type_id, 'name' => $content_type_name, 'type' => $content_type_id, ]; - $this->drupalPostForm(NULL, $edit, t('Save content type')); + $this->drupalPostForm(NULL, $edit, 'Save content type'); // Check the content type has been set to create new revisions. $this->assertTrue(NodeType::load($content_type_id)->shouldCreateNewRevision()); @@ -138,7 +138,7 @@ public function enableModerationThroughUi($content_type_id, $workflow_id = 'edit $this->drupalGet('/admin/config/workflow/workflows'); $this->assertSession()->linkByHrefExists('admin/config/workflow/workflows/manage/' . $workflow_id); $edit['bundles[' . $content_type_id . ']'] = TRUE; - $this->drupalPostForm('admin/config/workflow/workflows/manage/' . $workflow_id . '/type/node', $edit, t('Save')); + $this->drupalPostForm('admin/config/workflow/workflows/manage/' . $workflow_id . '/type/node', $edit, 'Save'); // Ensure the parent environment is up-to-date. // @see content_moderation_workflow_insert() \Drupal::service('entity_type.bundle.info')->clearCachedBundles(); diff --git a/core/modules/content_moderation/tests/src/Functional/NodeAccessTest.php b/core/modules/content_moderation/tests/src/Functional/NodeAccessTest.php index 6be4d3e00c12ce0b37a6f92bf6122b7e4ce727b2..23247e65b0c83be10a7853d026cfd91f29476509 100644 --- a/core/modules/content_moderation/tests/src/Functional/NodeAccessTest.php +++ b/core/modules/content_moderation/tests/src/Functional/NodeAccessTest.php @@ -90,7 +90,7 @@ public function testPageAccess() { $this->drupalPostForm(NULL, [ 'title[0][value]' => 'moderated content', 'moderation_state[0][state]' => 'draft', - ], t('Save')); + ], 'Save'); $node = $this->getNodeByTitle('moderated content'); if (!$node) { $this->fail('Test node was not saved correctly.'); @@ -120,7 +120,7 @@ public function testPageAccess() { $this->drupalLogin($this->adminUser); $this->drupalPostForm($edit_path, [ 'moderation_state[0][state]' => 'published', - ], t('Save')); + ], 'Save'); // Ensure access works correctly for anonymous users. $this->drupalLogout(); @@ -138,7 +138,7 @@ public function testPageAccess() { $this->drupalPostForm($edit_path, [ 'title[0][value]' => 'moderated content revised', 'moderation_state[0][state]' => 'draft', - ], t('Save')); + ], 'Save'); $this->drupalLogin($user); @@ -184,7 +184,7 @@ public function testPageAccess() { $this->assertSession()->statusCodeEquals(200); // Verify the moderation form is in place by publishing the node. - $this->drupalPostForm(NULL, [], t('Apply')); + $this->drupalPostForm(NULL, [], 'Apply'); $node = \Drupal::entityTypeManager()->getStorage('node')->loadUnchanged($node->id()); $this->assertEquals('published', $node->moderation_state->value); } diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php index 51058b89ee48aa0d0daf969f99220b536841d682..ffd226768bd1c2b3e0bcc6c4232e7a14e34d35c8 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php @@ -120,7 +120,7 @@ public function testContentTranslationContextualLinks() { 'settings[node][' . $this->bundle . '][translatable]' => TRUE, 'settings[node][' . $this->bundle . '][fields][field_test_text]' => TRUE, ]; - $this->drupalPostForm('admin/config/regional/content-language', $edit, t('Save configuration')); + $this->drupalPostForm('admin/config/regional/content-language', $edit, 'Save configuration'); $this->drupalLogout(); // Check that the link leads to the translate page. diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationEnableTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationEnableTest.php index ffd8a675aa63cdfa3ce41c7377cdad625d9f34d6..b94826b1499724b47af9c9ad01df75e8f2e5e5e1 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationEnableTest.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationEnableTest.php @@ -32,7 +32,7 @@ public function testEnable() { 'modules[content_translation][enable]' => TRUE, 'modules[language][enable]' => TRUE, ]; - $this->drupalPostForm('admin/modules', $edit, t('Install')); + $this->drupalPostForm('admin/modules', $edit, 'Install'); // Status messages are shown. $this->assertText('This site has only a single language enabled. Add at least one more language in order to translate content.'); @@ -54,7 +54,7 @@ public function testEnable() { 'entity_types[entity_test_mul]' => TRUE, 'settings[entity_test_mul][entity_test_mul][translatable]' => TRUE, ]; - $this->drupalPostForm(NULL, $edit, t('Save configuration')); + $this->drupalPostForm(NULL, $edit, 'Save configuration'); // No pending updates should be available. $this->drupalGet('admin/reports/status'); @@ -68,7 +68,7 @@ public function testEnable() { 'title_label' => 'title for foo', 'type' => 'foo', ]; - $this->drupalPostForm('admin/structure/types/add', $edit, t('Save content type')); + $this->drupalPostForm('admin/structure/types/add', $edit, 'Save content type'); $this->drupalGet('admin/config/regional/content-language'); $this->assertRaw('entity_types[node]'); } diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationLanguageChangeTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationLanguageChangeTest.php index a68b99d53a6c786ca696c41ac26e85b24204f2e4..aabbd2c36c8176631dbfdcb6d563315e012e14bb 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationLanguageChangeTest.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationLanguageChangeTest.php @@ -68,7 +68,7 @@ protected function setUp(): void { 'settings[node][article][translatable]' => TRUE, 'settings[node][article][settings][language][language_alterable]' => TRUE, ]; - $this->drupalPostForm('admin/config/regional/content-language', $edit, t('Save configuration')); + $this->drupalPostForm('admin/config/regional/content-language', $edit, 'Save configuration'); // Add an image field. $this->drupalGet('admin/structure/types/manage/article/fields/add-field'); @@ -77,9 +77,9 @@ protected function setUp(): void { 'field_name' => 'image_field', 'label' => 'image_field', ]; - $this->drupalPostForm(NULL, $edit, t('Save and continue')); - $this->drupalPostForm(NULL, [], t('Save field settings')); - $this->drupalPostForm(NULL, [], t('Save settings')); + $this->drupalPostForm(NULL, $edit, 'Save and continue'); + $this->drupalPostForm(NULL, [], 'Save field settings'); + $this->drupalPostForm(NULL, [], 'Save settings'); } /** @@ -91,12 +91,12 @@ public function testLanguageChange() { $edit = [ 'title[0][value]' => 'english_title', ]; - $this->drupalPostForm(NULL, $edit, t('Save')); + $this->drupalPostForm(NULL, $edit, 'Save'); // Create a translation in French. $this->clickLink('Translate'); $this->clickLink('Add'); - $this->drupalPostForm(NULL, [], t('Save (this translation)')); + $this->drupalPostForm(NULL, [], 'Save (this translation)'); $this->clickLink('Translate'); // Edit English translation. @@ -107,8 +107,8 @@ public function testLanguageChange() { 'langcode[0][value]' => 'de', 'files[field_image_field_0]' => $images->uri, ]; - $this->drupalPostForm(NULL, $edit, t('Upload')); - $this->drupalPostForm(NULL, ['field_image_field[0][alt]' => 'alternative_text'], t('Save (this translation)')); + $this->drupalPostForm(NULL, $edit, 'Upload'); + $this->drupalPostForm(NULL, ['field_image_field[0][alt]' => 'alternative_text'], 'Save (this translation)'); // Check that the translation languages are correct. $node = $this->getNodeByTitle('english_title'); @@ -127,13 +127,13 @@ public function testTitleDoesNotChangesOnChangingLanguageWidgetAndTriggeringAjax 'title[0][value]' => 'english_title', 'test_field_only_en_fr' => 'node created', ]; - $this->drupalPostForm(NULL, $edit, t('Save')); + $this->drupalPostForm(NULL, $edit, 'Save'); $this->assertEqual('node created', \Drupal::state()->get('test_field_only_en_fr')); // Create a translation in French. $this->clickLink('Translate'); $this->clickLink('Add'); - $this->drupalPostForm(NULL, [], t('Save (this translation)')); + $this->drupalPostForm(NULL, [], 'Save (this translation)'); $this->clickLink('Translate'); // Edit English translation. @@ -147,7 +147,7 @@ public function testTitleDoesNotChangesOnChangingLanguageWidgetAndTriggeringAjax 'langcode[0][value]' => 'de', 'files[field_image_field_0]' => $images->uri, ]; - $this->drupalPostForm(NULL, $edit, t('Upload')); + $this->drupalPostForm(NULL, $edit, 'Upload'); // Test the expected title after triggering an ajax call with a new // language selected. $this->assertRaw(' -
-
- \r\n
";
- $this->drupalPostForm('admin/config/content/formats/manage/' . $restricted, $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/content/formats/manage/' . $restricted, $edit, 'Save configuration');
$this->assertSession()->addressEquals('admin/config/content/formats/manage/' . $restricted);
$this->drupalGet('admin/config/content/formats/manage/' . $restricted);
// Check that the allowed HTML tag was added and the string reformatted.
@@ -232,7 +232,7 @@ public function testFilterAdmin() {
$edit = [];
$edit['filters[' . $second_filter . '][weight]'] = 1;
$edit['filters[' . $first_filter . '][weight]'] = 2;
- $this->drupalPostForm(NULL, $edit, t('Save configuration'));
+ $this->drupalPostForm(NULL, $edit, 'Save configuration');
$this->assertSession()->addressEquals('admin/config/content/formats/manage/' . $restricted);
$this->drupalGet('admin/config/content/formats/manage/' . $restricted);
$this->assertSession()->fieldValueEquals('filters[' . $second_filter . '][weight]', 1);
@@ -260,7 +260,7 @@ public function testFilterAdmin() {
$edit['roles[' . RoleInterface::AUTHENTICATED_ID . ']'] = 1;
$edit['filters[' . $second_filter . '][status]'] = TRUE;
$edit['filters[' . $first_filter . '][status]'] = TRUE;
- $this->drupalPostForm('admin/config/content/formats/add', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/content/formats/add', $edit, 'Save configuration');
$this->assertSession()->addressEquals('admin/config/content/formats');
$this->assertRaw(t('Added text format %format.', ['%format' => $edit['name']]));
@@ -273,7 +273,7 @@ public function testFilterAdmin() {
$this->assertSession()->checkboxChecked('filters[' . $first_filter . '][status]');
// Disable new filter.
- $this->drupalPostForm('admin/config/content/formats/manage/' . $format->id() . '/disable', [], t('Disable'));
+ $this->drupalPostForm('admin/config/content/formats/manage/' . $format->id() . '/disable', [], 'Disable');
$this->assertSession()->addressEquals('admin/config/content/formats');
$this->assertRaw(t('Disabled text format %format.', ['%format' => $edit['name']]));
@@ -282,7 +282,7 @@ public function testFilterAdmin() {
$edit = [];
$edit['roles[' . RoleInterface::ANONYMOUS_ID . ']'] = 0;
$edit['roles[' . RoleInterface::AUTHENTICATED_ID . ']'] = 1;
- $this->drupalPostForm('admin/config/content/formats/manage/' . $full, $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/content/formats/manage/' . $full, $edit, 'Save configuration');
$this->assertSession()->addressEquals('admin/config/content/formats/manage/' . $full);
$this->assertRaw(t('The text format %format has been updated.', ['%format' => $format->label()]));
@@ -301,7 +301,7 @@ public function testFilterAdmin() {
$edit['title[0][value]'] = $this->randomMachineName();
$edit['body[0][value]'] = $text;
$edit['body[0][format]'] = $basic;
- $this->drupalPostForm('node/add/page', $edit, t('Save'));
+ $this->drupalPostForm('node/add/page', $edit, 'Save');
$this->assertText('Basic page ' . $edit['title[0][value]'] . ' has been created.', 'Filtered node created.');
// Verify that the creation message contains a link to a node.
@@ -323,7 +323,7 @@ public function testFilterAdmin() {
->save();
$edit = [];
$edit['body[0][format]'] = $plain;
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
$this->drupalGet('node/' . $node->id());
$this->assertSession()->assertEscaped($text);
$this->config('filter.settings')
@@ -337,7 +337,7 @@ public function testFilterAdmin() {
// Allowed tags.
$edit = [];
$edit['filters[filter_html][settings][allowed_html]'] = ' -
-
- ';
- $this->drupalPostForm('admin/config/content/formats/manage/' . $basic, $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/content/formats/manage/' . $basic, $edit, 'Save configuration');
$this->assertSession()->addressEquals('admin/config/content/formats/manage/' . $basic);
$this->drupalGet('admin/config/content/formats/manage/' . $basic);
$this->assertSession()->fieldValueEquals('filters[filter_html][settings][allowed_html]', $edit['filters[filter_html][settings][allowed_html]']);
@@ -345,7 +345,7 @@ public function testFilterAdmin() {
// Full HTML.
$edit = [];
$edit['roles[' . RoleInterface::AUTHENTICATED_ID . ']'] = FALSE;
- $this->drupalPostForm('admin/config/content/formats/manage/' . $full, $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/content/formats/manage/' . $full, $edit, 'Save configuration');
$this->assertSession()->addressEquals('admin/config/content/formats/manage/' . $full);
$this->assertRaw(t('The text format %format has been updated.', ['%format' => $format->label()]));
$this->drupalGet('admin/config/content/formats/manage/' . $full);
@@ -355,7 +355,7 @@ public function testFilterAdmin() {
$edit = [];
$edit['filters[' . $second_filter . '][weight]'] = 2;
$edit['filters[' . $first_filter . '][weight]'] = 1;
- $this->drupalPostForm('admin/config/content/formats/manage/' . $basic, $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/content/formats/manage/' . $basic, $edit, 'Save configuration');
$this->assertSession()->addressEquals('admin/config/content/formats/manage/' . $basic);
$this->drupalGet('admin/config/content/formats/manage/' . $basic);
$this->assertSession()->fieldValueEquals('filters[' . $second_filter . '][weight]', $edit['filters[' . $second_filter . '][weight]']);
@@ -370,7 +370,7 @@ public function testUrlFilterAdmin() {
$edit = [
'filters[filter_url][settings][filter_url_length]' => $this->randomMachineName(4),
];
- $this->drupalPostForm('admin/config/content/formats/manage/basic_html', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/content/formats/manage/basic_html', $edit, 'Save configuration');
$this->assertNoRaw(t('The text format %format has been updated.', ['%format' => 'Basic HTML']));
}
diff --git a/core/modules/filter/tests/src/Functional/FilterDefaultFormatTest.php b/core/modules/filter/tests/src/Functional/FilterDefaultFormatTest.php
index 543bc66a450506706f08d5d986533016ee422247..89c5780c15dc950e8fe8f85c9b449327504f6763 100644
--- a/core/modules/filter/tests/src/Functional/FilterDefaultFormatTest.php
+++ b/core/modules/filter/tests/src/Functional/FilterDefaultFormatTest.php
@@ -38,7 +38,7 @@ public function testDefaultTextFormats() {
'format' => mb_strtolower($this->randomMachineName()),
'name' => $this->randomMachineName(),
];
- $this->drupalPostForm('admin/config/content/formats/add', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/content/formats/add', $edit, 'Save configuration');
$this->resetFilterCaches();
$formats[] = FilterFormat::load($edit['format']);
}
@@ -55,7 +55,7 @@ public function testDefaultTextFormats() {
$edit = [];
$edit['formats[' . $first_format->id() . '][weight]'] = -2;
$edit['formats[' . $second_format->id() . '][weight]'] = -1;
- $this->drupalPostForm('admin/config/content/formats', $edit, t('Save'));
+ $this->drupalPostForm('admin/config/content/formats', $edit, 'Save');
$this->resetFilterCaches();
// Check that each user's default format is the lowest weighted format that
@@ -71,7 +71,7 @@ public function testDefaultTextFormats() {
// default.
$edit = [];
$edit['formats[' . $second_format->id() . '][weight]'] = -3;
- $this->drupalPostForm('admin/config/content/formats', $edit, t('Save'));
+ $this->drupalPostForm('admin/config/content/formats', $edit, 'Save');
$this->resetFilterCaches();
$this->assertEqual(filter_default_format($first_user), filter_default_format($second_user), 'After the formats are reordered, both users have the same default format.');
}
diff --git a/core/modules/filter/tests/src/Functional/FilterFormatAccessTest.php b/core/modules/filter/tests/src/Functional/FilterFormatAccessTest.php
index d388b03530da3a5483a937eb9731d139505562b4..7552f9c36d2ea47f8c3a446149e77e29fd88a958 100644
--- a/core/modules/filter/tests/src/Functional/FilterFormatAccessTest.php
+++ b/core/modules/filter/tests/src/Functional/FilterFormatAccessTest.php
@@ -92,7 +92,7 @@ protected function setUp(): void {
'format' => mb_strtolower($this->randomMachineName()),
'name' => $this->randomMachineName(),
];
- $this->drupalPostForm('admin/config/content/formats/add', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/content/formats/add', $edit, 'Save configuration');
$this->resetFilterCaches();
$formats[] = FilterFormat::load($edit['format']);
}
@@ -226,7 +226,7 @@ public function testFormatWidgetPermissions() {
$edit['title[0][value]'] = $this->randomMachineName(8);
$edit[$body_value_key] = $this->randomMachineName(16);
$edit[$body_format_key] = $this->disallowedFormat->id();
- $this->drupalPostForm('node/add/page', $edit, t('Save'));
+ $this->drupalPostForm('node/add/page', $edit, 'Save');
$node = $this->drupalGetNodeByTitle($edit['title[0][value]']);
// Try to edit with a less privileged user.
@@ -241,11 +241,11 @@ public function testFormatWidgetPermissions() {
// Verify that title can be changed, but preview displays original body.
$new_edit = [];
$new_edit['title[0][value]'] = $this->randomMachineName(8);
- $this->drupalPostForm(NULL, $new_edit, t('Preview'));
+ $this->drupalPostForm(NULL, $new_edit, 'Preview');
$this->assertText($edit[$body_value_key], 'Old body found in preview.');
// Save and verify that only the title was changed.
- $this->drupalPostForm('node/' . $node->id() . '/edit', $new_edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $new_edit, 'Save');
$this->assertNoText($edit['title[0][value]'], 'Old title not found.');
$this->assertText($new_edit['title[0][value]'], 'New title found.');
$this->assertText($edit[$body_value_key], 'Old body found.');
@@ -285,7 +285,7 @@ public function testFormatWidgetPermissions() {
$new_title = $this->randomMachineName(8);
$edit = [];
$edit['title[0][value]'] = $new_title;
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
$this->assertText('Text format field is required.', 'Error message is displayed.');
$this->drupalGet('node/' . $node->id());
$this->assertText($old_title, 'Old title found.');
@@ -293,7 +293,7 @@ public function testFormatWidgetPermissions() {
// Now select a new text format and make sure the node can be saved.
$edit[$body_format_key] = filter_fallback_format();
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
$this->assertSession()->addressEquals('node/' . $node->id());
$this->assertText($new_title, 'New title found.');
$this->assertNoText($old_title, 'Old title not found.');
@@ -302,7 +302,7 @@ public function testFormatWidgetPermissions() {
// other formats on the site (leaving only the fallback format).
$this->drupalLogin($this->adminUser);
$edit = [$body_format_key => $this->allowedFormat->id()];
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
$this->assertSession()->addressEquals('node/' . $node->id());
foreach (filter_formats() as $format) {
if (!$format->isFallbackFormat()) {
@@ -320,13 +320,13 @@ public function testFormatWidgetPermissions() {
$new_title = $this->randomMachineName(8);
$edit = [];
$edit['title[0][value]'] = $new_title;
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
$this->assertText('Text format field is required.', 'Error message is displayed.');
$this->drupalGet('node/' . $node->id());
$this->assertText($old_title, 'Old title found.');
$this->assertNoText($new_title, 'New title not found.');
$edit[$body_format_key] = filter_fallback_format();
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
$this->assertSession()->addressEquals('node/' . $node->id());
$this->assertText($new_title, 'New title found.');
$this->assertNoText($old_title, 'Old title not found.');
diff --git a/core/modules/filter/tests/src/Functional/FilterHooksTest.php b/core/modules/filter/tests/src/Functional/FilterHooksTest.php
index 091186c3cbed98700be694338344c1c454baa5b9..61d8c8e77d9bf874cb98022bee1696a5448f06eb 100644
--- a/core/modules/filter/tests/src/Functional/FilterHooksTest.php
+++ b/core/modules/filter/tests/src/Functional/FilterHooksTest.php
@@ -49,7 +49,7 @@ public function testFilterHooks() {
$edit['format'] = mb_strtolower($this->randomMachineName());
$edit['name'] = $name;
$edit['roles[' . RoleInterface::ANONYMOUS_ID . ']'] = 1;
- $this->drupalPostForm('admin/config/content/formats/add', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/content/formats/add', $edit, 'Save configuration');
$this->assertRaw(t('Added text format %format.', ['%format' => $name]));
$this->assertText('hook_filter_format_insert invoked.');
@@ -58,7 +58,7 @@ public function testFilterHooks() {
// Update text format.
$edit = [];
$edit['roles[' . RoleInterface::AUTHENTICATED_ID . ']'] = 1;
- $this->drupalPostForm('admin/config/content/formats/manage/' . $format_id, $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/content/formats/manage/' . $format_id, $edit, 'Save configuration');
$this->assertRaw(t('The text format %format has been updated.', ['%format' => $name]));
$this->assertText('hook_filter_format_update invoked.');
@@ -68,11 +68,11 @@ public function testFilterHooks() {
$edit['title[0][value]'] = $title;
$edit['body[0][value]'] = $this->randomMachineName(32);
$edit['body[0][format]'] = $format_id;
- $this->drupalPostForm("node/add/{$type->id()}", $edit, t('Save'));
+ $this->drupalPostForm("node/add/{$type->id()}", $edit, 'Save');
$this->assertText($type_name . ' ' . $title . ' has been created.');
// Disable the text format.
- $this->drupalPostForm('admin/config/content/formats/manage/' . $format_id . '/disable', [], t('Disable'));
+ $this->drupalPostForm('admin/config/content/formats/manage/' . $format_id . '/disable', [], 'Disable');
$this->assertRaw(t('Disabled text format %format.', ['%format' => $name]));
$this->assertText('hook_filter_format_disable invoked.');
}
diff --git a/core/modules/filter/tests/src/Functional/FilterHtmlImageSecureTest.php b/core/modules/filter/tests/src/Functional/FilterHtmlImageSecureTest.php
index 8a0ddb5f6895d58d9e6d3d68656f4709d7571072..d25ca7582fb281877c06c2e1945e89fc77c01bd6 100644
--- a/core/modules/filter/tests/src/Functional/FilterHtmlImageSecureTest.php
+++ b/core/modules/filter/tests/src/Functional/FilterHtmlImageSecureTest.php
@@ -143,7 +143,7 @@ public function testImageSource() {
$edit = [
'comment_body[0][value]' => implode("\n", $comment),
];
- $this->drupalPostForm('node/' . $this->node->id(), $edit, t('Save'));
+ $this->drupalPostForm('node/' . $this->node->id(), $edit, 'Save');
foreach ($images as $image => $converted) {
$found = FALSE;
foreach ($this->xpath('//img[@testattribute="' . hash('sha256', $image) . '"]') as $element) {
diff --git a/core/modules/filter/tests/src/Functional/FilterSecurityTest.php b/core/modules/filter/tests/src/Functional/FilterSecurityTest.php
index 4c960f2beb11d722da4d3f7e680a7511081eecca..4ed377e3651e3728702d0678b0411205b86bcf7d 100644
--- a/core/modules/filter/tests/src/Functional/FilterSecurityTest.php
+++ b/core/modules/filter/tests/src/Functional/FilterSecurityTest.php
@@ -72,7 +72,7 @@ public function testDisableFilterModule() {
$edit = [
'filters[filter_test_replace][status]' => 1,
];
- $this->drupalPostForm('admin/config/content/formats/manage/' . $format_id, $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/content/formats/manage/' . $format_id, $edit, 'Save configuration');
// Verify that filter_test_replace filter replaced the content.
$this->drupalGet('node/' . $node->id());
@@ -80,7 +80,7 @@ public function testDisableFilterModule() {
$this->assertText('Filter: Testing filter', 'Testing filter output found.');
// Disable the text format entirely.
- $this->drupalPostForm('admin/config/content/formats/manage/' . $format_id . '/disable', [], t('Disable'));
+ $this->drupalPostForm('admin/config/content/formats/manage/' . $format_id . '/disable', [], 'Disable');
// Verify that the content is empty, because the text format does not exist.
$this->drupalGet('node/' . $node->id());
diff --git a/core/modules/forum/tests/src/Functional/ForumBlockTest.php b/core/modules/forum/tests/src/Functional/ForumBlockTest.php
index 21a424730f2d181dfd73ab2cda33fddc4cccbe45..be1cd9799c9b3a4ae30d5ac6b65f6f64dff34afa 100644
--- a/core/modules/forum/tests/src/Functional/ForumBlockTest.php
+++ b/core/modules/forum/tests/src/Functional/ForumBlockTest.php
@@ -175,7 +175,7 @@ protected function createForumTopics($count = 5) {
];
// Create the forum topic, preselecting the forum ID via a URL parameter.
- $this->drupalPostForm('node/add/forum', $edit, t('Save'), ['query' => ['forum_id' => 1]]);
+ $this->drupalPostForm('node/add/forum', $edit, 'Save', ['query' => ['forum_id' => 1]]);
$topics[] = $title;
}
diff --git a/core/modules/forum/tests/src/Functional/ForumIndexTest.php b/core/modules/forum/tests/src/Functional/ForumIndexTest.php
index 651b2b881ff184345f3a53a595334080a17ab842..c32a3be1d2d905b060622749ef295aad33c36e8b 100644
--- a/core/modules/forum/tests/src/Functional/ForumIndexTest.php
+++ b/core/modules/forum/tests/src/Functional/ForumIndexTest.php
@@ -55,7 +55,7 @@ public function testForumIndexStatus() {
$this->drupalGet("forum/$tid");
$this->clickLink(t('Add new @node_type', ['@node_type' => 'Forum topic']));
$this->assertSession()->addressEquals("node/add/forum?forum_id=$tid");
- $this->drupalPostForm(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, 'Save');
// Check that the node exists in the database.
$node = $this->drupalGetNodeByTitle($title);
@@ -67,7 +67,7 @@ public function testForumIndexStatus() {
'description[0][value]' => $this->randomMachineName(200),
'parent[0]' => $tid,
];
- $this->drupalPostForm('admin/structure/forum/add/forum', $edit, t('Save'));
+ $this->drupalPostForm('admin/structure/forum/add/forum', $edit, 'Save');
$this->assertSession()->linkExists('edit forum');
$tid_child = $tid + 1;
@@ -84,7 +84,7 @@ public function testForumIndexStatus() {
// Unpublish the node.
$edit = ['status[value]' => FALSE];
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
$this->drupalGet('node/' . $node->id());
$this->assertText('Access denied', 'Unpublished node is no longer accessible.');
diff --git a/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php b/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php
index 6c3ed2e08f90cd3981f10d944d6049923449a2fd..36ec58ed48d4fc5e846024a0a908399c3a226170 100644
--- a/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php
+++ b/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php
@@ -65,7 +65,7 @@ public function testForumNodeAccess() {
'body[0][value]' => $this->randomMachineName(200),
'private[0][value]' => TRUE,
];
- $this->drupalPostForm('node/add/forum', $edit, t('Save'), ['query' => ['forum_id' => 1]]);
+ $this->drupalPostForm('node/add/forum', $edit, 'Save', ['query' => ['forum_id' => 1]]);
$private_node = $this->drupalGetNodeByTitle($private_node_title);
$this->assertTrue(!empty($private_node), 'New private forum node found in database.');
@@ -75,7 +75,7 @@ public function testForumNodeAccess() {
'title[0][value]' => $public_node_title,
'body[0][value]' => $this->randomMachineName(200),
];
- $this->drupalPostForm('node/add/forum', $edit, t('Save'), ['query' => ['forum_id' => 1]]);
+ $this->drupalPostForm('node/add/forum', $edit, 'Save', ['query' => ['forum_id' => 1]]);
$public_node = $this->drupalGetNodeByTitle($public_node_title);
$this->assertTrue(!empty($public_node), 'New public forum node found in database.');
diff --git a/core/modules/forum/tests/src/Functional/ForumTest.php b/core/modules/forum/tests/src/Functional/ForumTest.php
index 85bd76ef3f31195e7fb3e86b7aa22fae412bea2c..eae3a3ae0920217633b0537cf1f8413658c90cc2 100644
--- a/core/modules/forum/tests/src/Functional/ForumTest.php
+++ b/core/modules/forum/tests/src/Functional/ForumTest.php
@@ -229,7 +229,7 @@ public function testForum() {
'create forum content',
'post comments',
]));
- $this->drupalPostForm('admin/structure/types/manage/forum', ['options[promote]' => 'promote'], t('Save content type'));
+ $this->drupalPostForm('admin/structure/types/manage/forum', ['options[promote]' => 'promote'], 'Save content type');
$this->createForumTopic($this->forum, FALSE);
$this->createForumTopic($this->forum, FALSE);
$this->drupalGet('node');
@@ -238,13 +238,13 @@ public function testForum() {
$node = $this->createForumTopic($this->forum, FALSE);
$edit = [];
$edit['comment_body[0][value]'] = $this->randomMachineName();
- $this->drupalPostForm('node/' . $node->id(), $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id(), $edit, 'Save');
$this->assertSession()->statusCodeEquals(200);
// Test editing a forum topic that has a comment.
$this->drupalLogin($this->editAnyTopicsUser);
$this->drupalGet('forum/' . $this->forum['tid']);
- $this->drupalPostForm('node/' . $node->id() . '/edit', [], t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', [], 'Save');
$this->assertSession()->statusCodeEquals(200);
// Test the root forum page title change.
@@ -284,7 +284,7 @@ public function testAddOrphanTopic() {
$edit['title[0][value]'] = $this->randomMachineName(10);
$edit['body[0][value]'] = $this->randomMachineName(120);
$this->drupalLogin($this->adminUser);
- $this->drupalPostForm('node/add/forum', $edit, t('Save'));
+ $this->drupalPostForm('node/add/forum', $edit, 'Save');
$nid_count = $this->container->get('entity_type.manager')
->getStorage('node')
@@ -310,7 +310,7 @@ private function doAdminTests($user) {
// Add forum to the Tools menu.
$edit = [];
- $this->drupalPostForm('admin/structure/menu/manage/tools', $edit, t('Save'));
+ $this->drupalPostForm('admin/structure/menu/manage/tools', $edit, 'Save');
$this->assertSession()->statusCodeEquals(200);
// Edit forum taxonomy.
@@ -338,7 +338,7 @@ private function doAdminTests($user) {
// Create second forum in container, destined to be deleted below.
$delete_forum = $this->createForum('forum', $this->forumContainer['tid']);
// Save forum overview.
- $this->drupalPostForm('admin/structure/forum/', [], t('Save'));
+ $this->drupalPostForm('admin/structure/forum/', [], 'Save');
$this->assertRaw(t('The configuration options have been saved.'));
// Delete this second forum.
$this->deleteForum($delete_forum['tid']);
@@ -393,7 +393,7 @@ public function editForumVocabulary() {
];
// Edit the vocabulary.
- $this->drupalPostForm('admin/structure/taxonomy/manage/' . $original_vocabulary->id(), $edit, t('Save'));
+ $this->drupalPostForm('admin/structure/taxonomy/manage/' . $original_vocabulary->id(), $edit, 'Save');
$this->assertSession()->statusCodeEquals(200);
$this->assertRaw(t('Updated vocabulary %name.', ['%name' => $edit['name']]));
@@ -437,7 +437,7 @@ public function createForum($type, $parent = 0) {
];
// Create forum.
- $this->drupalPostForm('admin/structure/forum/add/' . $type, $edit, t('Save'));
+ $this->drupalPostForm('admin/structure/forum/add/' . $type, $edit, 'Save');
$this->assertSession()->statusCodeEquals(200);
$type = ($type == 'container') ? 'forum container' : 'forum';
$this->assertText('Created new ' . $type . ' ' . $name . '.',
@@ -486,7 +486,7 @@ public function deleteForum($tid) {
$this->assertText('Are you sure you want to delete the forum');
$this->assertNoText('Add forum');
$this->assertNoText('Add forum container');
- $this->drupalPostForm(NULL, [], t('Delete'));
+ $this->drupalPostForm(NULL, [], 'Delete');
// Assert that the forum no longer exists.
$this->drupalGet('forum/' . $tid);
@@ -531,7 +531,7 @@ public function testForumWithNewPost() {
$edit = [];
$edit['subject[0][value]'] = $this->randomMachineName();
$edit['comment_body[0][value]'] = $this->randomMachineName();
- $this->drupalPostForm('node/' . $node->id(), $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id(), $edit, 'Save');
$this->assertSession()->statusCodeEquals(200);
// Test replying to a comment.
@@ -572,7 +572,7 @@ public function createForumTopic($forum, $container = FALSE) {
$tid = $forum['tid'];
// Create the forum topic, preselecting the forum ID via a URL parameter.
- $this->drupalPostForm('node/add/forum', $edit, t('Save'), ['query' => ['forum_id' => $tid]]);
+ $this->drupalPostForm('node/add/forum', $edit, 'Save', ['query' => ['forum_id' => $tid]]);
$type = t('Forum topic');
if ($container) {
@@ -660,7 +660,7 @@ private function verifyForums(EntityInterface $node, $admin, $response = 200) {
// Assume the topic is initially associated with $forum.
$edit['taxonomy_forums'] = $this->rootForum['tid'];
$edit['shadow'] = TRUE;
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
$this->assertText('Forum topic ' . $edit['title[0][value]'] . ' has been updated.', 'Forum node was edited');
// Verify topic was moved to a different forum.
@@ -675,7 +675,7 @@ private function verifyForums(EntityInterface $node, $admin, $response = 200) {
$this->assertTrue($forum_tid == $this->rootForum['tid'], 'The forum topic is linked to a different forum');
// Delete forum node.
- $this->drupalPostForm('node/' . $node->id() . '/delete', [], t('Delete'));
+ $this->drupalPostForm('node/' . $node->id() . '/delete', [], 'Delete');
$this->assertSession()->statusCodeEquals($response);
$this->assertRaw(t('Forum topic %title has been deleted.', ['%title' => $edit['title[0][value]']]));
}
diff --git a/core/modules/forum/tests/src/Functional/ForumUninstallTest.php b/core/modules/forum/tests/src/Functional/ForumUninstallTest.php
index e0ec9706c980204116b55296c56c5e2c96048372..f9f5bf2ddc7a9ec2fda4bc67deb676fe3c858a27 100644
--- a/core/modules/forum/tests/src/Functional/ForumUninstallTest.php
+++ b/core/modules/forum/tests/src/Functional/ForumUninstallTest.php
@@ -81,7 +81,7 @@ public function testForumUninstallWithField() {
$this->assertText('To uninstall Forum, first delete all Forum content');
// Delete the node.
- $this->drupalPostForm('node/' . $node->id() . '/delete', [], t('Delete'));
+ $this->drupalPostForm('node/' . $node->id() . '/delete', [], 'Delete');
// Attempt to uninstall forum.
$this->drupalGet('admin/modules/uninstall');
@@ -105,8 +105,8 @@ public function testForumUninstallWithField() {
$this->assertSession()->fieldExists('uninstall[forum]');
$this->drupalPostForm('admin/modules/uninstall', [
'uninstall[forum]' => 1,
- ], t('Uninstall'));
- $this->drupalPostForm(NULL, [], t('Uninstall'));
+ ], 'Uninstall');
+ $this->drupalPostForm(NULL, [], 'Uninstall');
// Check that the field is now deleted.
$field_storage = FieldStorageConfig::loadByName('node', 'taxonomy_forums');
@@ -119,11 +119,11 @@ public function testForumUninstallWithField() {
'title_label' => 'title for forum',
'type' => 'forum',
];
- $this->drupalPostForm('admin/structure/types/add', $edit, t('Save content type'));
+ $this->drupalPostForm('admin/structure/types/add', $edit, 'Save content type');
$this->assertTrue((bool) NodeType::load('forum'), 'Node type with machine forum created.');
$this->drupalGet('admin/structure/types/manage/forum');
$this->clickLink(t('Delete'));
- $this->drupalPostForm(NULL, [], t('Delete'));
+ $this->drupalPostForm(NULL, [], 'Delete');
$this->assertSession()->statusCodeEquals(200);
$this->assertFalse((bool) NodeType::load('forum'), 'Node type with machine forum deleted.');
diff --git a/core/modules/help_topics/tests/src/Functional/HelpTopicSearchTest.php b/core/modules/help_topics/tests/src/Functional/HelpTopicSearchTest.php
index 725c3fa928ad4e6d09c1354e03c8964044808815..054091e521896e18efb977968b81109085d67377 100644
--- a/core/modules/help_topics/tests/src/Functional/HelpTopicSearchTest.php
+++ b/core/modules/help_topics/tests/src/Functional/HelpTopicSearchTest.php
@@ -247,8 +247,8 @@ public function testUninstall() {
$this->drupalLogin($this->rootUser);
$edit = [];
$edit['uninstall[help_topics]'] = TRUE;
- $this->drupalPostForm('admin/modules/uninstall', $edit, t('Uninstall'));
- $this->drupalPostForm(NULL, [], t('Uninstall'));
+ $this->drupalPostForm('admin/modules/uninstall', $edit, 'Uninstall');
+ $this->drupalPostForm(NULL, [], 'Uninstall');
$this->assertText('The selected modules have been uninstalled.', 'Modules status has been updated.');
$this->drupalGet('admin/help');
$this->assertSession()->statusCodeEquals(200);
diff --git a/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php b/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php
index 612351ec2f0ac67413f270f9418765028728de29..4310dded84957ce8b50a254b50647e6bc6b4fe48 100644
--- a/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php
+++ b/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php
@@ -67,7 +67,7 @@ public function testNumericStyleName() {
'name' => $style_name,
'label' => $style_label,
];
- $this->drupalPostForm('admin/config/media/image-styles/add', $edit, t('Create new style'));
+ $this->drupalPostForm('admin/config/media/image-styles/add', $edit, 'Create new style');
$this->assertRaw(t('Style %name was created.', ['%name' => $style_label]));
$options = image_style_options();
$this->assertArrayHasKey($style_name, $options);
@@ -118,7 +118,7 @@ public function testStyle() {
'name' => $style_name,
'label' => $style_label,
];
- $this->drupalPostForm($admin_path . '/add', $edit, t('Create new style'));
+ $this->drupalPostForm($admin_path . '/add', $edit, 'Create new style');
$this->assertRaw(t('Style %name was created.', ['%name' => $style_label]));
// Ensure that the expected entity operations are there.
@@ -136,9 +136,9 @@ public function testStyle() {
$edit_data['data[' . $field . ']'] = $value;
}
// Add the effect.
- $this->drupalPostForm($style_path, ['new' => $effect], t('Add'));
+ $this->drupalPostForm($style_path, ['new' => $effect], 'Add');
if (!empty($edit)) {
- $this->drupalPostForm(NULL, $edit_data, t('Add effect'));
+ $this->drupalPostForm(NULL, $edit_data, 'Add effect');
}
}
@@ -209,7 +209,7 @@ public function testStyle() {
$image_path = $this->createSampleImage($style);
$this->assertEqual($this->getImageCount($style), 1, new FormattableMarkup('Image style %style image %file successfully generated.', ['%style' => $style->label(), '%file' => $image_path]));
- $this->drupalPostForm($style_path, $edit, t('Save'));
+ $this->drupalPostForm($style_path, $edit, 'Save');
// Note that after changing the style name, the style path is changed.
$style_path = 'admin/config/media/image-styles/manage/' . $style_name;
@@ -249,7 +249,7 @@ public function testStyle() {
$this->assertEqual($this->getImageCount($style), 1, new FormattableMarkup('Image style %style image %file successfully generated.', ['%style' => $style->label(), '%file' => $image_path]));
// Delete the 'image_crop' effect from the style.
- $this->drupalPostForm($style_path . '/effects/' . $uuids['image_crop'] . '/delete', [], t('Delete'));
+ $this->drupalPostForm($style_path . '/effects/' . $uuids['image_crop'] . '/delete', [], 'Delete');
// Confirm that the form submission was successful.
$this->assertSession()->statusCodeEquals(200);
$image_crop_effect = $style->getEffect($uuids['image_crop']);
@@ -273,8 +273,8 @@ public function testStyle() {
'data[random]' => 0,
'data[bgcolor]' => '',
];
- $this->drupalPostForm($style_path, ['new' => 'image_rotate'], t('Add'));
- $this->drupalPostForm(NULL, $edit, t('Add effect'));
+ $this->drupalPostForm($style_path, ['new' => 'image_rotate'], 'Add');
+ $this->drupalPostForm(NULL, $edit, 'Add effect');
$entity_type_manager = $this->container->get('entity_type.manager');
$style = $entity_type_manager->getStorage('image_style')->loadUnchanged($style_name);
$this->assertCount(6, $style->getEffects(), 'Rotate effect with transparent background was added.');
@@ -282,7 +282,7 @@ public function testStyle() {
// Style deletion form.
// Delete the style.
- $this->drupalPostForm($style_path . '/delete', [], t('Delete'));
+ $this->drupalPostForm($style_path . '/delete', [], 'Delete');
// Confirm the style directory has been removed.
$directory = 'public://styles/' . $style_name;
@@ -347,7 +347,7 @@ public function testStyleReplacement() {
'name' => $new_style_name,
'label' => $new_style_label,
];
- $this->drupalPostForm($style_path . $style_name, $edit, t('Save'));
+ $this->drupalPostForm($style_path . $style_name, $edit, 'Save');
$this->assertText('Changes to the style have been saved.', new FormattableMarkup('Style %name was renamed to %new_name.', ['%name' => $style_name, '%new_name' => $new_style_name]));
$this->drupalGet('node/' . $nid);
@@ -359,7 +359,7 @@ public function testStyleReplacement() {
$edit = [
'replacement' => 'thumbnail',
];
- $this->drupalPostForm($style_path . $new_style_name . '/delete', $edit, t('Delete'));
+ $this->drupalPostForm($style_path . $new_style_name . '/delete', $edit, 'Delete');
$message = t('The image style %name has been deleted.', ['%name' => $new_style_label]);
$this->assertRaw($message);
@@ -375,14 +375,14 @@ public function testEditEffect() {
// Add a scale effect.
$style_name = 'test_style_effect_edit';
$this->drupalGet('admin/config/media/image-styles/add');
- $this->drupalPostForm(NULL, ['label' => 'Test style effect edit', 'name' => $style_name], t('Create new style'));
- $this->drupalPostForm(NULL, ['new' => 'image_scale_and_crop'], t('Add'));
- $this->drupalPostForm(NULL, ['data[width]' => '300', 'data[height]' => '200'], t('Add effect'));
+ $this->drupalPostForm(NULL, ['label' => 'Test style effect edit', 'name' => $style_name], 'Create new style');
+ $this->drupalPostForm(NULL, ['new' => 'image_scale_and_crop'], 'Add');
+ $this->drupalPostForm(NULL, ['data[width]' => '300', 'data[height]' => '200'], 'Add effect');
$this->assertText('Scale and crop 300×200');
// There should normally be only one edit link on this page initially.
$this->clickLink(t('Edit'));
- $this->drupalPostForm(NULL, ['data[width]' => '360', 'data[height]' => '240'], t('Update effect'));
+ $this->drupalPostForm(NULL, ['data[width]' => '360', 'data[height]' => '240'], 'Update effect');
$this->assertText('Scale and crop 360×240');
// Check that the previous effect is replaced.
@@ -390,13 +390,13 @@ public function testEditEffect() {
// Add another scale effect.
$this->drupalGet('admin/config/media/image-styles/add');
- $this->drupalPostForm(NULL, ['label' => 'Test style scale edit scale', 'name' => 'test_style_scale_edit_scale'], t('Create new style'));
- $this->drupalPostForm(NULL, ['new' => 'image_scale'], t('Add'));
- $this->drupalPostForm(NULL, ['data[width]' => '12', 'data[height]' => '19'], t('Add effect'));
+ $this->drupalPostForm(NULL, ['label' => 'Test style scale edit scale', 'name' => 'test_style_scale_edit_scale'], 'Create new style');
+ $this->drupalPostForm(NULL, ['new' => 'image_scale'], 'Add');
+ $this->drupalPostForm(NULL, ['data[width]' => '12', 'data[height]' => '19'], 'Add effect');
// Edit the scale effect that was just added.
$this->clickLink(t('Edit'));
- $this->drupalPostForm(NULL, ['data[width]' => '24', 'data[height]' => '19'], t('Update effect'));
+ $this->drupalPostForm(NULL, ['data[width]' => '24', 'data[height]' => '19'], 'Update effect');
// Add another scale effect and make sure both exist. Click through from
// the overview to make sure that it is possible to add new effect then.
@@ -410,8 +410,8 @@ public function testEditEffect() {
}
$i++;
}
- $this->drupalPostForm(NULL, ['new' => 'image_scale'], t('Add'));
- $this->drupalPostForm(NULL, ['data[width]' => '12', 'data[height]' => '19'], t('Add effect'));
+ $this->drupalPostForm(NULL, ['new' => 'image_scale'], 'Add');
+ $this->drupalPostForm(NULL, ['data[width]' => '12', 'data[height]' => '19'], 'Add effect');
$this->assertText('Scale 24×19');
$this->assertText('Scale 12×19');
@@ -446,7 +446,7 @@ public function testFlushUserInterface() {
$this->assertSession()->linkByHrefExists($flush_path);
// Flush the image style derivatives using the user interface.
- $this->drupalPostForm($flush_path, [], t('Flush'));
+ $this->drupalPostForm($flush_path, [], 'Flush');
// The derivative image file should have been deleted.
$this->assertEqual($this->getImageCount($style), 0);
diff --git a/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php b/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php
index b04726a1014b69b15813371455e7f3379472e498..ec53a028b4460ae51eb0fd534fc3bd8437edca2a 100644
--- a/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php
+++ b/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php
@@ -278,7 +278,7 @@ public function testDefaultImages() {
);
$non_image = $this->drupalGetTestFiles('text');
- $this->drupalPostForm(NULL, ['files[settings_default_image_uuid]' => \Drupal::service('file_system')->realpath($non_image[0]->uri)], t("Upload"));
+ $this->drupalPostForm(NULL, ['files[settings_default_image_uuid]' => \Drupal::service('file_system')->realpath($non_image[0]->uri)], 'Upload');
$this->assertText('The specified file text-0.txt could not be uploaded.');
$this->assertText('Only files with the following extensions are allowed: png gif jpg jpeg.');
diff --git a/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php b/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php
index 17952ce9e908848025345058a6bd2af321e44040..cea209aa79315583fa86a6da2029dc8426d91afa 100644
--- a/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php
+++ b/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php
@@ -301,7 +301,7 @@ public function testImageFieldSettings() {
$field_name . '[0][alt]' => $image['#alt'],
$field_name . '[0][title]' => $image['#title'],
];
- $this->drupalPostForm('node/' . $nid . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $nid . '/edit', $edit, 'Save');
$default_output = str_replace("\n", NULL, $renderer->renderRoot($image));
$this->assertRaw($default_output);
@@ -311,7 +311,7 @@ public function testImageFieldSettings() {
$field_name . '[0][alt]' => $this->randomMachineName($test_size),
$field_name . '[0][title]' => $this->randomMachineName($test_size),
];
- $this->drupalPostForm('node/' . $nid . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $nid . '/edit', $edit, 'Save');
$schema = $field->getFieldStorageDefinition()->getSchema();
$this->assertRaw(t('Alternative text cannot be longer than %max characters but is currently %length characters long.', [
'%max' => $schema['columns']['alt']['length'],
@@ -329,13 +329,13 @@ public function testImageFieldSettings() {
// 1, so we need to make sure the file widget prevents these notices by
// providing all settings, even if they are not used.
// @see FileWidget::formMultipleElements().
- $this->drupalPostForm('admin/structure/types/manage/article/fields/node.article.' . $field_name . '/storage', ['cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED], t('Save field settings'));
+ $this->drupalPostForm('admin/structure/types/manage/article/fields/node.article.' . $field_name . '/storage', ['cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED], 'Save field settings');
$edit = [
'files[' . $field_name . '_1][]' => \Drupal::service('file_system')->realpath($test_image->uri),
];
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
// Add the required alt text.
- $this->drupalPostForm(NULL, [$field_name . '[1][alt]' => $alt], t('Save'));
+ $this->drupalPostForm(NULL, [$field_name . '[1][alt]' => $alt], 'Save');
$this->assertText('Article ' . $node->getTitle() . ' has been updated.');
// Assert ImageWidget::process() calls FieldWidget::process().
@@ -380,7 +380,7 @@ public function testImageFieldDefaultImage() {
'settings[default_image][alt]' => $alt,
'settings[default_image][title]' => $title,
];
- $this->drupalPostForm("admin/structure/types/manage/article/fields/node.article.$field_name/storage", $edit, t('Save field settings'));
+ $this->drupalPostForm("admin/structure/types/manage/article/fields/node.article.$field_name/storage", $edit, 'Save field settings');
// Clear field definition cache so the new default image is detected.
\Drupal::service('entity_field.manager')->clearCachedFieldDefinitions();
$field_storage = FieldStorageConfig::loadByName('node', $field_name);
@@ -452,7 +452,7 @@ public function testImageFieldDefaultImage() {
'settings[default_image][alt]' => $alt,
'settings[default_image][title]' => $title,
];
- $this->drupalPostForm('admin/structure/types/manage/article/fields/node.article.' . $private_field_name . '/storage', $edit, t('Save field settings'));
+ $this->drupalPostForm('admin/structure/types/manage/article/fields/node.article.' . $private_field_name . '/storage', $edit, 'Save field settings');
// Clear field definition cache so the new default image is detected.
\Drupal::service('entity_field.manager')->clearCachedFieldDefinitions();
diff --git a/core/modules/image/tests/src/Functional/ImageFieldTestBase.php b/core/modules/image/tests/src/Functional/ImageFieldTestBase.php
index 3bd5fe5d8769a27e76521cba8948232b1e1169cb..b5bcaec0eb33d041511bb23947ab326315d6daec 100644
--- a/core/modules/image/tests/src/Functional/ImageFieldTestBase.php
+++ b/core/modules/image/tests/src/Functional/ImageFieldTestBase.php
@@ -85,7 +85,7 @@ public function previewNodeImage($image, $field_name, $type) {
'title[0][value]' => $this->randomMachineName(),
];
$edit['files[' . $field_name . '_0]'] = \Drupal::service('file_system')->realpath($image->uri);
- $this->drupalPostForm('node/add/' . $type, $edit, t('Preview'));
+ $this->drupalPostForm('node/add/' . $type, $edit, 'Preview');
}
/**
@@ -105,10 +105,10 @@ public function uploadNodeImage($image, $field_name, $type, $alt = '') {
'title[0][value]' => $this->randomMachineName(),
];
$edit['files[' . $field_name . '_0]'] = \Drupal::service('file_system')->realpath($image->uri);
- $this->drupalPostForm('node/add/' . $type, $edit, t('Save'));
+ $this->drupalPostForm('node/add/' . $type, $edit, 'Save');
if ($alt) {
// Add alt text.
- $this->drupalPostForm(NULL, [$field_name . '[0][alt]' => $alt], t('Save'));
+ $this->drupalPostForm(NULL, [$field_name . '[0][alt]' => $alt], 'Save');
}
// Retrieve ID of the newly created node from the current URL.
diff --git a/core/modules/image/tests/src/Functional/ImageFieldValidateTest.php b/core/modules/image/tests/src/Functional/ImageFieldValidateTest.php
index 9a85e402c4d194e0dc38a36db2d9d3ed98bf66e1..02b625d9d0b92b15216af60d9d9a8173393081c6 100644
--- a/core/modules/image/tests/src/Functional/ImageFieldValidateTest.php
+++ b/core/modules/image/tests/src/Functional/ImageFieldValidateTest.php
@@ -41,8 +41,8 @@ public function testValid() {
$this->assertFileExists($expected_path . '/' . $image_files[0]->filename);
// Remove the image.
- $this->drupalPostForm('node/' . $node . '/edit', [], t('Remove'));
- $this->drupalPostForm(NULL, [], t('Save'));
+ $this->drupalPostForm('node/' . $node . '/edit', [], 'Remove');
+ $this->drupalPostForm(NULL, [], 'Save');
// Get invalid image test files from simpletest.
$dir = 'core/tests/fixtures/files';
@@ -60,7 +60,7 @@ public function testValid() {
$edit = [
'files[' . $field_name . '_0]' => $file_system->realpath($zero_size_image->uri),
];
- $this->drupalPostForm('node/' . $node . '/edit', $edit, t('Upload'));
+ $this->drupalPostForm('node/' . $node . '/edit', $edit, 'Upload');
$this->assertFileNotExists($expected_path . '/' . $zero_size_image->filename);
// Try uploading an invalid image.
@@ -68,7 +68,7 @@ public function testValid() {
$edit = [
'files[' . $field_name . '_0]' => $file_system->realpath($invalid_image->uri),
];
- $this->drupalPostForm('node/' . $node . '/edit', $edit, t('Upload'));
+ $this->drupalPostForm('node/' . $node . '/edit', $edit, 'Upload');
$this->assertFileNotExists($expected_path . '/' . $invalid_image->filename);
// Upload a valid image again.
@@ -76,7 +76,7 @@ public function testValid() {
$edit = [
'files[' . $field_name . '_0]' => $file_system->realpath($valid_image->uri),
];
- $this->drupalPostForm('node/' . $node . '/edit', $edit, t('Upload'));
+ $this->drupalPostForm('node/' . $node . '/edit', $edit, 'Upload');
$this->assertFileExists($expected_path . '/' . $valid_image->filename);
}
@@ -196,7 +196,7 @@ public function testRequiredAttributes() {
$edit = [
'title[0][value]' => $this->randomMachineName(),
];
- $this->drupalPostForm('node/add/article', $edit, t('Save'));
+ $this->drupalPostForm('node/add/article', $edit, 'Save');
$this->assertNoText('Alternative text field is required.');
$this->assertNoText('Title field is required.');
@@ -209,7 +209,7 @@ public function testRequiredAttributes() {
$edit = [
'title[0][value]' => $this->randomMachineName(),
];
- $this->drupalPostForm('node/add/article', $edit, t('Save'));
+ $this->drupalPostForm('node/add/article', $edit, 'Save');
$this->assertNoText('Alternative text field is required.');
$this->assertNoText('Title field is required.');
@@ -232,7 +232,7 @@ public function testEmpty($field_name, $required, $cardinality, $form_element_na
$edit = [
'title[0][value]' => 'Article with edit-access-allowed image field',
];
- $this->drupalPostForm(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, 'Save');
$this->assertSession()->pageTextContains($expected_page_text_when_edit_access_allowed);
// Test with field edit access forbidden.
@@ -242,7 +242,7 @@ public function testEmpty($field_name, $required, $cardinality, $form_element_na
$edit = [
'title[0][value]' => 'Article with edit-access-forbidden image field',
];
- $this->drupalPostForm(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, 'Save');
$this->assertSession()->pageTextContains($expected_page_text_when_edit_access_forbidden);
}
diff --git a/core/modules/image/tests/src/Functional/ImageOnTranslatedEntityTest.php b/core/modules/image/tests/src/Functional/ImageOnTranslatedEntityTest.php
index b687a430eca224a367cc2d92a15a8862ac8a2d93..d888b2e358bb68fb725f19c7aab0665bacd78206 100644
--- a/core/modules/image/tests/src/Functional/ImageOnTranslatedEntityTest.php
+++ b/core/modules/image/tests/src/Functional/ImageOnTranslatedEntityTest.php
@@ -71,11 +71,11 @@ protected function setUp(): void {
// Add a second and third language.
$edit = [];
$edit['predefined_langcode'] = 'fr';
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language');
$edit = [];
$edit['predefined_langcode'] = 'nl';
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language');
}
/**
@@ -107,22 +107,22 @@ public function testSyncedImages() {
$edit = [];
$name = 'files[' . $this->fieldName . '_0]';
$edit[$name] = \Drupal::service('file_system')->realpath($this->drupalGetTestFiles('image')[0]->uri);
- $this->drupalPostForm('node/' . $default_language_node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $default_language_node->id() . '/edit', $edit, 'Save');
$edit = [$this->fieldName . '[0][alt]' => 'Lost in translation image', $this->fieldName . '[0][title]' => 'Lost in translation image title'];
- $this->drupalPostForm(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, 'Save');
$first_fid = $this->getLastFileId();
// Translate the node into French: remove the existing file.
- $this->drupalPostForm('node/' . $default_language_node->id() . '/translations/add/en/fr', [], t('Remove'));
+ $this->drupalPostForm('node/' . $default_language_node->id() . '/translations/add/en/fr', [], 'Remove');
// Upload a different file.
$edit = [];
$edit['title[0][value]'] = 'Scarlett Johansson';
$name = 'files[' . $this->fieldName . '_0]';
$edit[$name] = \Drupal::service('file_system')->realpath($this->drupalGetTestFiles('image')[1]->uri);
- $this->drupalPostForm(NULL, $edit, t('Save (this translation)'));
+ $this->drupalPostForm(NULL, $edit, 'Save (this translation)');
$edit = [$this->fieldName . '[0][alt]' => 'Scarlett Johansson image', $this->fieldName . '[0][title]' => 'Scarlett Johansson image title'];
- $this->drupalPostForm(NULL, $edit, t('Save (this translation)'));
+ $this->drupalPostForm(NULL, $edit, 'Save (this translation)');
// This inspects the HTML after the post of the translation, the image
// should be displayed on the original node.
$this->assertRaw('alt="Lost in translation image"');
@@ -145,16 +145,16 @@ public function testSyncedImages() {
$this->assertTrue($file->isPermanent());
// Translate the node into dutch: remove the existing file.
- $this->drupalPostForm('node/' . $default_language_node->id() . '/translations/add/en/nl', [], t('Remove'));
+ $this->drupalPostForm('node/' . $default_language_node->id() . '/translations/add/en/nl', [], 'Remove');
// Upload a different file.
$edit = [];
$edit['title[0][value]'] = 'Akiko Takeshita';
$name = 'files[' . $this->fieldName . '_0]';
$edit[$name] = \Drupal::service('file_system')->realpath($this->drupalGetTestFiles('image')[2]->uri);
- $this->drupalPostForm(NULL, $edit, t('Save (this translation)'));
+ $this->drupalPostForm(NULL, $edit, 'Save (this translation)');
$edit = [$this->fieldName . '[0][alt]' => 'Akiko Takeshita image', $this->fieldName . '[0][title]' => 'Akiko Takeshita image title'];
- $this->drupalPostForm(NULL, $edit, t('Save (this translation)'));
+ $this->drupalPostForm(NULL, $edit, 'Save (this translation)');
$third_fid = $this->getLastFileId();
\Drupal::entityTypeManager()->getStorage('file')->resetCache();
@@ -180,18 +180,18 @@ public function testSyncedImages() {
$this->assertTrue($file->isPermanent());
// Edit the second translation: remove the existing file.
- $this->drupalPostForm('fr/node/' . $default_language_node->id() . '/edit', [], t('Remove'));
+ $this->drupalPostForm('fr/node/' . $default_language_node->id() . '/edit', [], 'Remove');
// Upload a different file.
$edit = [];
$edit['title[0][value]'] = 'Giovanni Ribisi';
$name = 'files[' . $this->fieldName . '_0]';
$edit[$name] = \Drupal::service('file_system')->realpath($this->drupalGetTestFiles('image')[3]->uri);
- $this->drupalPostForm(NULL, $edit, t('Save (this translation)'));
+ $this->drupalPostForm(NULL, $edit, 'Save (this translation)');
$name = $this->fieldName . '[0][alt]';
$edit = [$name => 'Giovanni Ribisi image'];
- $this->drupalPostForm(NULL, $edit, t('Save (this translation)'));
+ $this->drupalPostForm(NULL, $edit, 'Save (this translation)');
$replaced_second_fid = $this->getLastFileId();
\Drupal::entityTypeManager()->getStorage('file')->resetCache();
@@ -208,7 +208,7 @@ public function testSyncedImages() {
$this->assertTrue($file->isPermanent());
// Delete the third translation.
- $this->drupalPostForm('nl/node/' . $default_language_node->id() . '/delete', [], t('Delete Dutch translation'));
+ $this->drupalPostForm('nl/node/' . $default_language_node->id() . '/delete', [], 'Delete Dutch translation');
\Drupal::entityTypeManager()->getStorage('file')->resetCache();
@@ -224,7 +224,7 @@ public function testSyncedImages() {
$this->assertTrue($file->isTemporary());
// Delete the all translations.
- $this->drupalPostForm('node/' . $default_language_node->id() . '/delete', [], t('Delete all translations'));
+ $this->drupalPostForm('node/' . $default_language_node->id() . '/delete', [], 'Delete all translations');
\Drupal::entityTypeManager()->getStorage('file')->resetCache();
diff --git a/core/modules/image/tests/src/Functional/ImageStyleDeleteTest.php b/core/modules/image/tests/src/Functional/ImageStyleDeleteTest.php
index f3f00d12cb2559f478707fc6c6e69df2237c4d3c..55da96d082ff90eb6effadf41c1775165f26fb10 100644
--- a/core/modules/image/tests/src/Functional/ImageStyleDeleteTest.php
+++ b/core/modules/image/tests/src/Functional/ImageStyleDeleteTest.php
@@ -40,7 +40,7 @@ public function testDelete() {
// Delete 'medium' image style but replace it with 'thumbnail'. This style
// is involved in 'node.page.default' display view and form.
- $this->drupalPostForm(NULL, ['replacement' => 'thumbnail'], t('Delete'));
+ $this->drupalPostForm(NULL, ['replacement' => 'thumbnail'], 'Delete');
/** @var \Drupal\Core\Entity\Display\EntityViewDisplayInterface $view_display */
$view_display = EntityViewDisplay::load('node.page.default');
@@ -62,7 +62,7 @@ public function testDelete() {
$this->assertNoRaw(t('All images that have been generated for this style will be permanently deleted. The dependent configurations might need manual reconfiguration.'));
// Delete 'thumbnail' image style. Provide no replacement.
- $this->drupalPostForm(NULL, [], t('Delete'));
+ $this->drupalPostForm(NULL, [], 'Delete');
$view_display = EntityViewDisplay::load('node.page.default');
// Checks that the formatter setting is disabled.
@@ -80,7 +80,7 @@ public function testDelete() {
$this->assertRaw(t('If this style is in use on the site, you may select another style to replace it. All images that have been generated for this style will be permanently deleted. If no replacement style is selected, the dependent configurations might need manual reconfiguration.'));
$this->assertNoRaw(t('All images that have been generated for this style will be permanently deleted. The dependent configurations might need manual reconfiguration.'));
// Delete 'wide' image style. Provide no replacement.
- $this->drupalPostForm(NULL, [], t('Delete'));
+ $this->drupalPostForm(NULL, [], 'Delete');
// Now, there's only one image style configured on the system: 'large'.
$this->drupalGet('admin/config/media/image-styles/manage/large/delete');
diff --git a/core/modules/image/tests/src/Functional/ImageStyleFlushTest.php b/core/modules/image/tests/src/Functional/ImageStyleFlushTest.php
index 75a799645e9623c3bad3c1a5a1d7208554be0fa2..1575e0e029c0421353956e55ebf3a7ff21279a09 100644
--- a/core/modules/image/tests/src/Functional/ImageStyleFlushTest.php
+++ b/core/modules/image/tests/src/Functional/ImageStyleFlushTest.php
@@ -80,14 +80,14 @@ public function testFlush() {
'name' => $style_name,
'label' => $style_label,
];
- $this->drupalPostForm('admin/config/media/image-styles/add', $edit, t('Create new style'));
+ $this->drupalPostForm('admin/config/media/image-styles/add', $edit, 'Create new style');
// Add each sample effect to the style.
foreach ($effect_edits as $effect => $edit) {
// Add the effect.
- $this->drupalPostForm($style_path, ['new' => $effect], t('Add'));
+ $this->drupalPostForm($style_path, ['new' => $effect], 'Add');
if (!empty($edit)) {
- $this->drupalPostForm(NULL, $edit, t('Add effect'));
+ $this->drupalPostForm(NULL, $edit, 'Add effect');
}
}
@@ -111,9 +111,9 @@ public function testFlush() {
foreach ($style->getEffects() as $uuid => $effect) {
$uuids[$effect->getPluginId()] = $uuid;
}
- $this->drupalPostForm($style_path . '/effects/' . $uuids['image_scale'] . '/delete', [], t('Delete'));
+ $this->drupalPostForm($style_path . '/effects/' . $uuids['image_scale'] . '/delete', [], 'Delete');
$this->assertSession()->statusCodeEquals(200);
- $this->drupalPostForm($style_path, [], t('Save'));
+ $this->drupalPostForm($style_path, [], 'Save');
$this->assertSession()->statusCodeEquals(200);
// Post flush, expected 1 image in the 'public' wrapper (sample.png).
diff --git a/core/modules/image/tests/src/FunctionalJavascript/ImageAdminStylesTest.php b/core/modules/image/tests/src/FunctionalJavascript/ImageAdminStylesTest.php
index acc4bdc5b2f305ee9dc03eaf228d99fca5646bee..2546bc811ab83a4d67d437e6f6719eaac28596f8 100644
--- a/core/modules/image/tests/src/FunctionalJavascript/ImageAdminStylesTest.php
+++ b/core/modules/image/tests/src/FunctionalJavascript/ImageAdminStylesTest.php
@@ -41,10 +41,10 @@ public function testAjaxEnabledEffectForm() {
$assert->pageTextContains("Style $style_label was created.");
// Add two Ajax-enabled test effects.
- $this->drupalPostForm($style_path, ['new' => 'image_module_test_ajax'], t('Add'));
- $this->drupalPostForm(NULL, $effect_edit, t('Add effect'));
- $this->drupalPostForm($style_path, ['new' => 'image_module_test_ajax'], t('Add'));
- $this->drupalPostForm(NULL, $effect_edit, t('Add effect'));
+ $this->drupalPostForm($style_path, ['new' => 'image_module_test_ajax'], 'Add');
+ $this->drupalPostForm(NULL, $effect_edit, 'Add effect');
+ $this->drupalPostForm($style_path, ['new' => 'image_module_test_ajax'], 'Add');
+ $this->drupalPostForm(NULL, $effect_edit, 'Add effect');
// Load the saved image style.
$style = ImageStyle::load($style_name);
diff --git a/core/modules/language/tests/src/Functional/LanguageBlockSettingsVisibilityTest.php b/core/modules/language/tests/src/Functional/LanguageBlockSettingsVisibilityTest.php
index 64d9b241c731a445d4fe13669cfc626671aa1d53..fbb8f01d12309a699295f48b9039b53f92b64d4e 100644
--- a/core/modules/language/tests/src/Functional/LanguageBlockSettingsVisibilityTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageBlockSettingsVisibilityTest.php
@@ -25,7 +25,7 @@ public function testUnnecessaryLanguageSettingsVisibility() {
'administer blocks',
]);
$this->drupalLogin($admin_user);
- $this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'hu'], t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'hu'], 'Add language');
$this->drupalGet('admin/structure/block/add/system_menu_block:admin/stark');
$this->assertSession()->fieldNotExists("edit-visibility-language-langcodes-und");
$this->assertSession()->fieldNotExists("edit-visibility-language-langcodes-zxx");
diff --git a/core/modules/language/tests/src/Functional/LanguageBrowserDetectionTest.php b/core/modules/language/tests/src/Functional/LanguageBrowserDetectionTest.php
index 15c563989ca724d27053310c91ef18915cbc9676..30f1afc0c5f3425a3ae15fe683dacd7c8e799f3c 100644
--- a/core/modules/language/tests/src/Functional/LanguageBrowserDetectionTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageBrowserDetectionTest.php
@@ -50,7 +50,7 @@ public function testUIBrowserLanguageMappings() {
// Confirm the delete.
$edit = [];
- $this->drupalPostForm('admin/config/regional/language/detection/browser/delete/' . $browser_langcode, $edit, t('Confirm'));
+ $this->drupalPostForm('admin/config/regional/language/detection/browser/delete/' . $browser_langcode, $edit, 'Confirm');
// We need raw here because %browser will add HTML.
$t_args = [
@@ -68,13 +68,13 @@ public function testUIBrowserLanguageMappings() {
'new_mapping[browser_langcode]' => 'xx',
'new_mapping[drupal_langcode]' => 'en',
];
- $this->drupalPostForm('admin/config/regional/language/detection/browser', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/language/detection/browser', $edit, 'Save configuration');
$this->assertSession()->addressEquals(Url::fromRoute('language.negotiation_browser'));
$this->assertSession()->fieldValueEquals('edit-mappings-xx-browser-langcode', 'xx');
$this->assertSession()->fieldValueEquals('edit-mappings-xx-drupal-langcode', 'en');
// Add the same custom mapping again.
- $this->drupalPostForm('admin/config/regional/language/detection/browser', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/language/detection/browser', $edit, 'Save configuration');
$this->assertText('Browser language codes must be unique.');
// Change browser language code of our custom mapping to zh-sg.
@@ -82,7 +82,7 @@ public function testUIBrowserLanguageMappings() {
'mappings[xx][browser_langcode]' => 'zh-sg',
'mappings[xx][drupal_langcode]' => 'en',
];
- $this->drupalPostForm('admin/config/regional/language/detection/browser', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/language/detection/browser', $edit, 'Save configuration');
$this->assertText('Browser language codes must be unique.');
// Change Drupal language code of our custom mapping to zh-hans.
@@ -90,7 +90,7 @@ public function testUIBrowserLanguageMappings() {
'mappings[xx][browser_langcode]' => 'xx',
'mappings[xx][drupal_langcode]' => 'zh-hans',
];
- $this->drupalPostForm('admin/config/regional/language/detection/browser', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/language/detection/browser', $edit, 'Save configuration');
$this->assertSession()->addressEquals(Url::fromRoute('language.negotiation_browser'));
$this->assertSession()->fieldValueEquals('edit-mappings-xx-browser-langcode', 'xx');
$this->assertSession()->fieldValueEquals('edit-mappings-xx-drupal-langcode', 'zh-hans');
diff --git a/core/modules/language/tests/src/Functional/LanguageConfigSchemaTest.php b/core/modules/language/tests/src/Functional/LanguageConfigSchemaTest.php
index a1e63570fac933f684891cd9703769cd86120799..ee36d9e4c0ae6bfbb5359ae642b46f7e03a08345 100644
--- a/core/modules/language/tests/src/Functional/LanguageConfigSchemaTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageConfigSchemaTest.php
@@ -63,7 +63,7 @@ public function testValidLanguageConfigSchema() {
$edit['settings[user][user][settings][language][language_alterable]'] = TRUE;
$edit['settings[user][user][settings][language][langcode]'] = 'en';
- $this->drupalPostForm($settings_path, $edit, t('Save configuration'));
+ $this->drupalPostForm($settings_path, $edit, 'Save configuration');
$config_data = $this->config('language.content_settings.menu_link_content.menu_link_content');
// Make sure configuration saved correctly.
diff --git a/core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php b/core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php
index 5a64197be4b45571e053e27dc963445a0abde68c..7aaa6a588234b969e834249dbfedf95063aadff8 100644
--- a/core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageConfigurationElementTest.php
@@ -177,7 +177,7 @@ public function testNodeTypeUpdate() {
'language_configuration[langcode]' => 'current_interface',
'language_configuration[language_alterable]' => TRUE,
];
- $this->drupalPostForm('admin/structure/types/manage/article', $edit, t('Save content type'));
+ $this->drupalPostForm('admin/structure/types/manage/article', $edit, 'Save content type');
// Check the language default configuration for the articles.
$configuration = ContentLanguageSettings::loadByEntityTypeBundle('node', 'article');
$uuid = $configuration->uuid();
@@ -187,7 +187,7 @@ public function testNodeTypeUpdate() {
$edit = [
'title_label' => 'Name',
];
- $this->drupalPostForm('admin/structure/types/manage/article', $edit, t('Save content type'));
+ $this->drupalPostForm('admin/structure/types/manage/article', $edit, 'Save content type');
// Check that we still have the settings for the updated node type.
$configuration = ContentLanguageSettings::loadByEntityTypeBundle('node', 'article');
$this->assertEqual($configuration->getDefaultLangcode(), 'current_interface', 'The default language configuration has been kept on the updated Article content type.');
@@ -215,14 +215,14 @@ public function testNodeTypeDelete() {
'language_configuration[langcode]' => 'authors_default',
'language_configuration[language_alterable]' => TRUE,
];
- $this->drupalPostForm('admin/structure/types/manage/article', $edit, t('Save content type'));
+ $this->drupalPostForm('admin/structure/types/manage/article', $edit, 'Save content type');
// Check the language default configuration for articles is present.
$configuration = \Drupal::entityTypeManager()->getStorage('language_content_settings')->load('node.article');
$this->assertNotEmpty($configuration, 'The language configuration is present.');
// Delete 'article' bundle.
- $this->drupalPostForm('admin/structure/types/manage/article/delete', [], t('Delete'));
+ $this->drupalPostForm('admin/structure/types/manage/article/delete', [], 'Delete');
// Check that the language configuration has been deleted.
\Drupal::entityTypeManager()->getStorage('language_content_settings')->resetCache();
@@ -246,7 +246,7 @@ public function testTaxonomyVocabularyUpdate() {
'default_language[langcode]' => 'current_interface',
'default_language[language_alterable]' => TRUE,
];
- $this->drupalPostForm('admin/structure/taxonomy/manage/country', $edit, t('Save'));
+ $this->drupalPostForm('admin/structure/taxonomy/manage/country', $edit, 'Save');
// Check the language default configuration.
$configuration = ContentLanguageSettings::loadByEntityTypeBundle('taxonomy_term', 'country');
@@ -257,7 +257,7 @@ public function testTaxonomyVocabularyUpdate() {
$edit = [
'name' => 'Nation',
];
- $this->drupalPostForm('admin/structure/taxonomy/manage/country', $edit, t('Save'));
+ $this->drupalPostForm('admin/structure/taxonomy/manage/country', $edit, 'Save');
// Check that we still have the settings for the updated vocabulary.
$configuration = ContentLanguageSettings::loadByEntityTypeBundle('taxonomy_term', 'country');
$this->assertEqual($configuration->getDefaultLangcode(), 'current_interface', 'The default language configuration has been kept on the updated Country vocabulary.');
diff --git a/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php b/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php
index 7709282770889861aec4d5bed6fbd0f9c66d28a2..5c429a073acb52cb01e1d67eb3169608e96c6e74 100644
--- a/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php
@@ -77,7 +77,7 @@ public function testLanguageConfiguration() {
$edit = [
'site_default_language' => 'fr',
];
- $this->drupalPostForm(NULL, $edit, t('Save configuration'));
+ $this->drupalPostForm(NULL, $edit, 'Save configuration');
$this->rebuildContainer();
$this->assertSession()->checkboxChecked('edit-site-default-language-fr');
$this->assertSession()->addressEquals(Url::fromRoute('entity.configurable_language.collection', [], ['langcode' => 'fr']));
@@ -94,14 +94,14 @@ public function testLanguageConfiguration() {
$edit = [
'prefix[fr]' => 'french',
];
- $this->drupalPostForm(NULL, $edit, t('Save configuration'));
+ $this->drupalPostForm(NULL, $edit, 'Save configuration');
$this->assertSession()->fieldValueEquals("prefix[fr]", 'french');
// Check that the prefix can be removed.
$edit = [
'prefix[fr]' => '',
];
- $this->drupalPostForm(NULL, $edit, t('Save configuration'));
+ $this->drupalPostForm(NULL, $edit, 'Save configuration');
$this->assertNoText('The prefix may only be left blank for the selected detection fallback language.', 'The path prefix can be removed for the default language');
// Change default negotiation language.
@@ -111,19 +111,19 @@ public function testLanguageConfiguration() {
$edit = [
'prefix[en]' => '',
];
- $this->drupalPostForm(NULL, $edit, t('Save configuration'));
+ $this->drupalPostForm(NULL, $edit, 'Save configuration');
$this->assertText('The prefix may only be left blank for the selected detection fallback language.');
// Check that prefix cannot be changed to contain a slash.
$edit = [
'prefix[en]' => 'foo/bar',
];
- $this->drupalPostForm(NULL, $edit, t('Save configuration'));
+ $this->drupalPostForm(NULL, $edit, 'Save configuration');
$this->assertText('The prefix may not contain a slash.', 'English prefix cannot be changed to contain a slash.');
// Remove English language and add a new Language to check if langcode of
// Language entity is 'en'.
- $this->drupalPostForm('admin/config/regional/language/delete/en', [], t('Delete'));
+ $this->drupalPostForm('admin/config/regional/language/delete/en', [], 'Delete');
$this->rebuildContainer();
$this->assertRaw(t('The %language (%langcode) language has been removed.', ['%language' => 'English', '%langcode' => 'en']));
diff --git a/core/modules/language/tests/src/Functional/LanguageCustomLanguageConfigurationTest.php b/core/modules/language/tests/src/Functional/LanguageCustomLanguageConfigurationTest.php
index b11815ca43370d231f73808483a65bd31677a35d..374c95d1d32d379cfa6349825a8d1a0241996211 100644
--- a/core/modules/language/tests/src/Functional/LanguageCustomLanguageConfigurationTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageCustomLanguageConfigurationTest.php
@@ -42,7 +42,7 @@ public function testLanguageConfiguration() {
$edit = [
'predefined_langcode' => 'custom',
];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add custom language');
// Test validation on missing values.
$this->assertText('Language code field is required.');
$this->assertText('Language name field is required.');
@@ -57,7 +57,7 @@ public function testLanguageConfiguration() {
'label' => 'evil markup',
'direction' => LanguageInterface::DIRECTION_LTR,
];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add custom language');
$this->assertRaw(t('%field must be a valid language tag as defined by the W3C.', [
'%field' => t('Language code'),
@@ -75,7 +75,7 @@ public function testLanguageConfiguration() {
'direction' => LanguageInterface::DIRECTION_LTR,
];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add custom language');
$this->assertRaw(t(
'The language %language has been created and can now be used.',
['%language' => $edit['label']]
@@ -91,7 +91,7 @@ public function testLanguageConfiguration() {
];
// Add the language the first time.
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add custom language');
$this->assertRaw(t(
'The language %language has been created and can now be used.',
['%language' => $edit['label']]
@@ -99,7 +99,7 @@ public function testLanguageConfiguration() {
$this->assertSession()->addressEquals(Url::fromRoute('entity.configurable_language.collection'));
// Add the language a second time and confirm that this is not allowed.
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add custom language');
$this->assertRaw(t(
'The language %language (%langcode) already exists.',
['%language' => $edit['label'], '%langcode' => $edit['langcode']]
diff --git a/core/modules/language/tests/src/Functional/LanguageListModuleInstallTest.php b/core/modules/language/tests/src/Functional/LanguageListModuleInstallTest.php
index 60810139dc5d092ed60101dfe5df1ccc925e247a..473153241d8402d6a56f9223e03db87c16dd6fc1 100644
--- a/core/modules/language/tests/src/Functional/LanguageListModuleInstallTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageListModuleInstallTest.php
@@ -37,7 +37,7 @@ public function testModuleInstallLanguageList() {
$this->drupalLogin($admin_user);
$edit = [];
$edit['modules[language][enable]'] = 'language';
- $this->drupalPostForm('admin/modules', $edit, t('Install'));
+ $this->drupalPostForm('admin/modules', $edit, 'Install');
$this->assertEqual(\Drupal::state()->get('language_test.language_count_preinstall', 0), 1, 'Using LanguageManager::getLanguages() returns 1 language during Language installation.');
diff --git a/core/modules/language/tests/src/Functional/LanguageListTest.php b/core/modules/language/tests/src/Functional/LanguageListTest.php
index 87d31a16ea2d9a4344608f062ad69992229fb1ac..26e798e6943f93fd59214da7cba0f6eb6ad01f25 100644
--- a/core/modules/language/tests/src/Functional/LanguageListTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageListTest.php
@@ -47,7 +47,7 @@ public function testLanguageList() {
$edit = [
'predefined_langcode' => 'fr',
];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language');
$this->assertText('French', 'Language added successfully.');
$this->assertSession()->addressEquals(Url::fromRoute('entity.configurable_language.collection'));
@@ -68,7 +68,7 @@ public function testLanguageList() {
'label' => $name,
'direction' => Language::DIRECTION_LTR,
];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add custom language');
$this->assertSession()->addressEquals(Url::fromRoute('entity.configurable_language.collection'));
$this->assertRaw('"edit-languages-' . $langcode . '-weight"');
$this->assertText($name, 'Test language added.');
@@ -84,7 +84,7 @@ public function testLanguageList() {
$edit = [
'site_default_language' => $langcode,
];
- $this->drupalPostForm(NULL, $edit, t('Save configuration'));
+ $this->drupalPostForm(NULL, $edit, 'Save configuration');
$this->rebuildContainer();
$this->assertSession()->checkboxNotChecked('edit-site-default-language-en');
$this->assertSession()->addressEquals(Url::fromRoute('entity.configurable_language.collection', [], ['language' => $language]));
@@ -102,7 +102,7 @@ public function testLanguageList() {
$edit = [
'label' => $name,
];
- $this->drupalPostForm('admin/config/regional/language/edit/' . $langcode, $edit, t('Save language'));
+ $this->drupalPostForm('admin/config/regional/language/edit/' . $langcode, $edit, 'Save language');
$this->assertRaw($name);
$this->assertSession()->addressEquals(Url::fromRoute('entity.configurable_language.collection', [], ['language' => $language]));
@@ -110,7 +110,7 @@ public function testLanguageList() {
$edit = [
'site_default_language' => 'en',
];
- $this->drupalPostForm($path, $edit, t('Save configuration'));
+ $this->drupalPostForm($path, $edit, 'Save configuration');
$this->rebuildContainer();
// Ensure 'delete' link works.
$this->drupalGet('admin/config/regional/language');
@@ -124,7 +124,7 @@ public function testLanguageList() {
$this->assertRaw($name);
// Delete the language for real. This a confirm form, we do not need any
// fields changed.
- $this->drupalPostForm('admin/config/regional/language/delete/' . $langcode, [], t('Delete'));
+ $this->drupalPostForm('admin/config/regional/language/delete/' . $langcode, [], 'Delete');
// We need raw here because %language and %langcode will add HTML.
$t_args = ['%language' => $name, '%langcode' => $langcode];
$this->assertRaw(t('The %language (%langcode) language has been removed.', $t_args));
@@ -134,7 +134,7 @@ public function testLanguageList() {
$this->assertSession()->statusCodeEquals(404);
// Delete French.
- $this->drupalPostForm('admin/config/regional/language/delete/fr', [], t('Delete'));
+ $this->drupalPostForm('admin/config/regional/language/delete/fr', [], 'Delete');
// Make sure the "language_count" state has been updated correctly.
$this->rebuildContainer();
// We need raw here because %language and %langcode will add HTML.
@@ -157,7 +157,7 @@ public function testLanguageList() {
'label' => $name,
'direction' => Language::DIRECTION_LTR,
];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add custom language');
$this->assertSession()->addressEquals(Url::fromRoute('entity.configurable_language.collection'));
$this->assertText($name, 'Name found.');
@@ -169,12 +169,12 @@ public function testLanguageList() {
$edit = [
'site_default_language' => $langcode,
];
- $this->drupalPostForm(NULL, $edit, t('Save configuration'));
+ $this->drupalPostForm(NULL, $edit, 'Save configuration');
$this->rebuildContainer();
$this->assertSession()->checkboxNotChecked('edit-site-default-language-en');
$this->assertSession()->addressEquals(Url::fromRoute('entity.configurable_language.collection', [], ['language' => $language]));
- $this->drupalPostForm('admin/config/regional/language/delete/en', [], t('Delete'));
+ $this->drupalPostForm('admin/config/regional/language/delete/en', [], 'Delete');
// We need raw here because %language and %langcode will add HTML.
$t_args = ['%language' => 'English', '%langcode' => 'en'];
$this->assertRaw(t('The %language (%langcode) language has been removed.', $t_args));
diff --git a/core/modules/language/tests/src/Functional/LanguageLocaleListTest.php b/core/modules/language/tests/src/Functional/LanguageLocaleListTest.php
index d2c304ef47db472d1d1db6618ce60e6c58024c51..8af8570d39f0505625fc720848d4c7d7c94d8d00 100644
--- a/core/modules/language/tests/src/Functional/LanguageLocaleListTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageLocaleListTest.php
@@ -48,7 +48,7 @@ public function testLanguageLocaleList() {
$edit = [
'predefined_langcode' => 'fr',
];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language');
$this->assertText('The language French has been created and can now be used');
$this->assertSession()->addressEquals(Url::fromRoute('entity.configurable_language.collection'));
$this->rebuildContainer();
diff --git a/core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php b/core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php
index 68ed0a64ca142b5246635ffab1536f7ae361c2ef..1265e8bc6951e4bb58f5a51d0c0344e1734f3e43 100644
--- a/core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageNegotiationInfoTest.php
@@ -38,7 +38,7 @@ protected function setUp(): void {
'administer modules',
]);
$this->drupalLogin($admin_user);
- $this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'it'], t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'it'], 'Add language');
}
/**
@@ -104,7 +104,7 @@ public function testInfoAlterations() {
$test_type . '[enabled][' . $test_method_id . ']' => TRUE,
$test_type . '[configurable]' => TRUE,
];
- $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
+ $this->drupalPostForm('admin/config/regional/language/detection', $edit, 'Save settings');
// Alter language negotiation info to remove interface language negotiation
// method.
@@ -188,15 +188,15 @@ public function testConfigLangTypeAlterations() {
// Editing config.
$edit = [$test_type . '[configurable]' => TRUE];
- $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
+ $this->drupalPostForm('admin/config/regional/language/detection', $edit, 'Save settings');
$this->assertTrue($this->isLanguageTypeConfigurable($test_type), 'Language type is now configurable.');
// After installing another module, the config should be the same.
- $this->drupalPostForm('admin/modules', ['modules[test_module][enable]' => 1], t('Install'));
+ $this->drupalPostForm('admin/modules', ['modules[test_module][enable]' => 1], 'Install');
$this->assertTrue($this->isLanguageTypeConfigurable($test_type), 'Language type is still configurable.');
// After uninstalling the other module, the config should be the same.
- $this->drupalPostForm('admin/modules/uninstall', ['uninstall[test_module]' => 1], t('Uninstall'));
+ $this->drupalPostForm('admin/modules/uninstall', ['uninstall[test_module]' => 1], 'Uninstall');
$this->assertTrue($this->isLanguageTypeConfigurable($test_type), 'Language type is still configurable.');
}
diff --git a/core/modules/language/tests/src/Functional/LanguageNegotiationUrlTest.php b/core/modules/language/tests/src/Functional/LanguageNegotiationUrlTest.php
index 8cf44e0de8be75875df7a8b323430fe6d3e34997..0fc31417483f41ce62282178ef80e221350aad13 100644
--- a/core/modules/language/tests/src/Functional/LanguageNegotiationUrlTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageNegotiationUrlTest.php
@@ -2,7 +2,6 @@
namespace Drupal\Tests\language\Functional;
-use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Tests\BrowserTestBase;
/**
@@ -11,8 +10,6 @@
*/
class LanguageNegotiationUrlTest extends BrowserTestBase {
- use StringTranslationTrait;
-
/**
* {@inheritdoc}
*/
@@ -53,7 +50,7 @@ protected function setUp(): void {
]);
$this->drupalLogin($this->user);
- $this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'de'], $this->t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'de'], 'Add language');
}
/**
@@ -69,13 +66,13 @@ public function testDomain() {
'domain[en]' => $_SERVER['HTTP_HOST'],
'domain[de]' => "de.$_SERVER[HTTP_HOST]",
];
- $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, $this->t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, 'Save configuration');
$nodeValues = [
'title[0][value]' => 'Test',
'path[0][alias]' => '/eng/test',
];
- $this->drupalPostForm('node/add/article', $nodeValues, $this->t('Save'));
+ $this->drupalPostForm('node/add/article', $nodeValues, 'Save');
$this->assertSession()->statusCodeEquals(200);
}
diff --git a/core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php b/core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php
index 405ef7ed9a01adb6a016181e49d1afeea6160022..cf80da6dbf8781baeb4a0c666da17f4ef9f8050c 100644
--- a/core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php
+++ b/core/modules/language/tests/src/Functional/LanguagePathMonolingualTest.php
@@ -37,16 +37,16 @@ protected function setUp(): void {
// Enable French language.
$edit = [];
$edit['predefined_langcode'] = 'fr';
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language');
// Make French the default language.
$edit = [
'site_default_language' => 'fr',
];
- $this->drupalPostForm('admin/config/regional/language', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/language', $edit, 'Save configuration');
// Delete English.
- $this->drupalPostForm('admin/config/regional/language/delete/en', [], t('Delete'));
+ $this->drupalPostForm('admin/config/regional/language/delete/en', [], 'Delete');
// Changing the default language causes a container rebuild. Therefore need
// to rebuild the container in the test environment.
@@ -59,7 +59,7 @@ protected function setUp(): void {
// Set language detection to URL.
$edit = ['language_interface[enabled][language-url]' => TRUE];
- $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
+ $this->drupalPostForm('admin/config/regional/language/detection', $edit, 'Save settings');
$this->drupalPlaceBlock('local_actions_block');
}
diff --git a/core/modules/language/tests/src/Functional/LanguageSelectorTranslatableTest.php b/core/modules/language/tests/src/Functional/LanguageSelectorTranslatableTest.php
index c58d135441529fd9c17467bede98951b7f178e53..c6fe77d8c01a109fafe9f9b9b814ca98cb099d14 100644
--- a/core/modules/language/tests/src/Functional/LanguageSelectorTranslatableTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageSelectorTranslatableTest.php
@@ -70,7 +70,7 @@ protected function getAdministratorPermissions() {
public function testLanguageStringSelector() {
// Add another language.
$edit = ['predefined_langcode' => 'es'];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language');
// Translate the string English in Spanish (Inglés). Override config entity.
$name_translation = 'Inglés';
diff --git a/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php b/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php
index 9ae12f3d76b4770be321f64635f0e72c3a701c96..a72f5af05b7cf71b549efe5cb954aca4346d7bbe 100644
--- a/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageSwitchingTest.php
@@ -54,14 +54,14 @@ public function testLanguageBlock() {
$edit = [
'predefined_langcode' => 'fr',
];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language');
// Set the native language name.
$this->saveNativeLanguageName('fr', 'français');
// Enable URL language detection and selection.
$edit = ['language_interface[enabled][language-url]' => '1'];
- $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
+ $this->drupalPostForm('admin/config/regional/language/detection', $edit, 'Save settings');
// Enable the language switching block.
$block = $this->drupalPlaceBlock('language_block:' . LanguageInterface::TYPE_INTERFACE, [
@@ -195,14 +195,14 @@ public function testLanguageBlockWithDomain() {
'language_interface[enabled][language-url]' => TRUE,
'language_interface[weight][language-url]' => -10,
];
- $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
+ $this->drupalPostForm('admin/config/regional/language/detection', $edit, 'Save settings');
// Do not allow blank domain.
$edit = [
'language_negotiation_url_part' => LanguageNegotiationUrl::CONFIG_DOMAIN,
'domain[en]' => '',
];
- $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, 'Save configuration');
$this->assertText('The domain may not be left blank for English', 'The form does not allow blank domains.');
// Change the domain for the Italian language.
@@ -211,7 +211,7 @@ public function testLanguageBlockWithDomain() {
'domain[en]' => \Drupal::request()->getHost(),
'domain[it]' => 'it.example.com',
];
- $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, 'Save configuration');
$this->assertText('The configuration options have been saved', 'Domain configuration is saved.');
// Enable the language switcher block.
@@ -247,11 +247,11 @@ public function testLanguageLinkActiveClass() {
$edit = [
'predefined_langcode' => 'fr',
];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language');
// Enable URL language detection and selection.
$edit = ['language_interface[enabled][language-url]' => '1'];
- $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
+ $this->drupalPostForm('admin/config/regional/language/detection', $edit, 'Save settings');
$this->doTestLanguageLinkActiveClassAuthenticated();
$this->doTestLanguageLinkActiveClassAnonymous();
@@ -267,11 +267,11 @@ public function testLanguageBodyClass() {
$edit = [
'predefined_langcode' => 'fr',
];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language');
// Enable URL language detection and selection.
$edit = ['language_interface[enabled][language-url]' => '1'];
- $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
+ $this->drupalPostForm('admin/config/regional/language/detection', $edit, 'Save settings');
// Check if the default (English) admin/config page has the right class.
$this->drupalGet('admin/config');
@@ -417,14 +417,14 @@ public function testLanguageSessionSwitchLinks() {
$edit = [
'predefined_langcode' => 'fr',
];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language');
// Enable session language detection and selection.
$edit = [
'language_interface[enabled][language-url]' => FALSE,
'language_interface[enabled][language-session]' => TRUE,
];
- $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
+ $this->drupalPostForm('admin/config/regional/language/detection', $edit, 'Save settings');
// Enable the language switching block.
$this->drupalPlaceBlock('language_block:' . LanguageInterface::TYPE_INTERFACE, [
diff --git a/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php b/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php
index f90abf91cd07fa0c7d8383074b7b59fbbdd504a6..73e3898a0819e1f68e928b42b29978f693014711 100644
--- a/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageUILanguageNegotiationTest.php
@@ -142,29 +142,29 @@ public function testUILanguageNegotiation() {
'string' => $default_string,
'langcode' => $langcode_browser_fallback,
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$textarea = current($this->xpath('//textarea'));
$lid = $textarea->getAttribute('name');
$edit = [
$lid => $language_browser_fallback_string,
];
- $this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations'));
+ $this->drupalPostForm('admin/config/regional/translate', $edit, 'Save translations');
$search = [
'string' => $default_string,
'langcode' => $langcode,
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$textarea = current($this->xpath('//textarea'));
$lid = $textarea->getAttribute('name');
$edit = [
$lid => $language_string,
];
- $this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations'));
+ $this->drupalPostForm('admin/config/regional/translate', $edit, 'Save translations');
// Configure selected language negotiation to use zh-hans.
$edit = ['selected_langcode' => $langcode];
- $this->drupalPostForm('admin/config/regional/language/detection/selected', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/language/detection/selected', $edit, 'Save configuration');
$test = [
'language_negotiation' => [LanguageNegotiationSelected::METHOD_ID],
'path' => 'admin/config',
@@ -368,7 +368,7 @@ public function testUILanguageNegotiation() {
// Go by session preference.
$language_negotiation_session_param = $this->randomMachineName();
$edit = ['language_negotiation_session_param' => $language_negotiation_session_param];
- $this->drupalPostForm('admin/config/regional/language/detection/session', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/language/detection/session', $edit, 'Save configuration');
$tests = [
[
'language_negotiation' => [LanguageNegotiationSession::METHOD_ID],
@@ -432,7 +432,7 @@ public function testUrlLanguageFallback() {
// Enable the path prefix for the default language: this way any unprefixed
// URL must have a valid fallback value.
$edit = ['prefix[en]' => 'en'];
- $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, 'Save configuration');
// Enable browser and URL language detection.
$edit = [
@@ -441,7 +441,7 @@ public function testUrlLanguageFallback() {
'language_interface[weight][language-browser]' => -8,
'language_interface[weight][language-url]' => -10,
];
- $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
+ $this->drupalPostForm('admin/config/regional/language/detection', $edit, 'Save settings');
$this->drupalGet('admin/config/regional/language/detection');
// Enable the language switcher block.
@@ -491,14 +491,14 @@ public function testLanguageDomain() {
'language_interface[enabled][language-url]' => TRUE,
'language_interface[weight][language-url]' => -10,
];
- $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
+ $this->drupalPostForm('admin/config/regional/language/detection', $edit, 'Save settings');
// Do not allow blank domain.
$edit = [
'language_negotiation_url_part' => LanguageNegotiationUrl::CONFIG_DOMAIN,
'domain[en]' => '',
];
- $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, 'Save configuration');
$this->assertText('The domain may not be left blank for English', 'The form does not allow blank domains.');
$this->rebuildContainer();
@@ -508,7 +508,7 @@ public function testLanguageDomain() {
'domain[en]' => $base_url_host,
'domain[it]' => 'it.example.com',
];
- $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, 'Save configuration');
$this->assertText('The configuration options have been saved', 'Domain configuration is saved.');
$this->rebuildContainer();
@@ -518,7 +518,7 @@ public function testLanguageDomain() {
'domain[en]' => $base_url_host,
'domain[it]' => 'it.example.com/',
];
- $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, 'Save configuration');
$this->assertRaw(t('The domain for %language may only contain the domain name, not a trailing slash, protocol and/or port.', ['%language' => 'Italian']));
// Build the link we're going to test.
@@ -555,7 +555,7 @@ public function testContentCustomization() {
'language_content[enabled][language-url]' => FALSE,
'language_content[enabled][language-session]' => TRUE,
];
- $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
+ $this->drupalPostForm('admin/config/regional/language/detection', $edit, 'Save settings');
// Check if configurability persisted.
$config = $this->config('language.types');
@@ -584,7 +584,7 @@ public function testDisableLanguageSwitcher() {
$edit = [
'language_content[configurable]' => FALSE,
];
- $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
+ $this->drupalPostForm('admin/config/regional/language/detection', $edit, 'Save settings');
$this->assertSession()->statusCodeEquals(200);
// Check if the language switcher block has been removed.
diff --git a/core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php b/core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php
index 0a72a3ddf0bf079a55e262dc5f26ad483f5de3da..4b411e7d4b7a70f112ab55e551b0d837e89af724 100644
--- a/core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php
@@ -48,11 +48,11 @@ protected function setUp(): void {
// Install French language.
$edit = [];
$edit['predefined_langcode'] = 'fr';
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language');
// Enable URL language detection and selection.
$edit = ['language_interface[enabled][language-url]' => 1];
- $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
+ $this->drupalPostForm('admin/config/regional/language/detection', $edit, 'Save settings');
// Check that drupalSettings contains path prefix.
$this->drupalGet('fr/admin/config/regional/language/detection');
@@ -116,7 +116,7 @@ public function testDomainNameNegotiationPort() {
'domain[en]' => $base_url_host,
'domain[fr]' => $language_domain,
];
- $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, 'Save configuration');
// Rebuild the container so that the new language gets picked up by services
// that hold the list of languages.
$this->rebuildContainer();
diff --git a/core/modules/link/tests/src/Functional/LinkFieldTest.php b/core/modules/link/tests/src/Functional/LinkFieldTest.php
index bf76de6015025d19daa4bbb6dceaf94a74ab01b8..efb45896ec6e712cf539cc13b09664c87c92a735 100644
--- a/core/modules/link/tests/src/Functional/LinkFieldTest.php
+++ b/core/modules/link/tests/src/Functional/LinkFieldTest.php
@@ -217,7 +217,7 @@ protected function assertValidEntries($field_name, array $valid_entries) {
$edit = [
"{$field_name}[0][uri]" => $uri,
];
- $this->drupalPostForm('entity_test/add', $edit, t('Save'));
+ $this->drupalPostForm('entity_test/add', $edit, 'Save');
preg_match('|entity_test/manage/(\d+)|', $this->getUrl(), $match);
$id = $match[1];
$this->assertText('entity_test ' . $id . ' has been created.');
@@ -238,7 +238,7 @@ protected function assertInvalidEntries($field_name, array $invalid_entries) {
$edit = [
"{$field_name}[0][uri]" => $invalid_value,
];
- $this->drupalPostForm('entity_test/add', $edit, t('Save'));
+ $this->drupalPostForm('entity_test/add', $edit, 'Save');
$this->assertText(strtr($error_message, ['@link_path' => $invalid_value]));
}
}
@@ -309,7 +309,7 @@ public function testLinkTitle() {
$edit = [
"{$field_name}[0][title]" => 'Example',
];
- $this->drupalPostForm(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, 'Save');
$this->assertText('The URL field is required when the Link text field is specified.');
}
if ($title_setting === DRUPAL_REQUIRED) {
@@ -317,14 +317,14 @@ public function testLinkTitle() {
$edit = [
"{$field_name}[0][uri]" => 'http://www.example.com',
];
- $this->drupalPostForm(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, 'Save');
$this->assertText('Link text field is required if there is URL input.');
// Verify that the link text is not required, if the URL is empty.
$edit = [
"{$field_name}[0][uri]" => '',
];
- $this->drupalPostForm(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, 'Save');
$this->assertNoText('Link text field is required.');
// Verify that a URL and link text meets requirements.
@@ -333,7 +333,7 @@ public function testLinkTitle() {
"{$field_name}[0][uri]" => 'http://www.example.com',
"{$field_name}[0][title]" => 'Example',
];
- $this->drupalPostForm(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, 'Save');
$this->assertNoText('Link text field is required.');
}
}
@@ -345,7 +345,7 @@ public function testLinkTitle() {
"{$field_name}[0][uri]" => $value,
"{$field_name}[0][title]" => '',
];
- $this->drupalPostForm(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, 'Save');
preg_match('|entity_test/manage/(\d+)|', $this->getUrl(), $match);
$id = $match[1];
$this->assertText('entity_test ' . $id . ' has been created.');
@@ -359,7 +359,7 @@ public function testLinkTitle() {
$edit = [
"{$field_name}[0][title]" => $title,
];
- $this->drupalPostForm("entity_test/manage/$id/edit", $edit, t('Save'));
+ $this->drupalPostForm("entity_test/manage/$id/edit", $edit, 'Save');
$this->assertText('entity_test ' . $id . ' has been updated.');
$output = $this->renderTestEntity($id);
@@ -429,7 +429,7 @@ public function testLinkFormatter() {
];
// Assert label is shown.
$this->assertText('Read more about this entity');
- $this->drupalPostForm(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, 'Save');
preg_match('|entity_test/manage/(\d+)|', $this->getUrl(), $match);
$id = $match[1];
$this->assertText('entity_test ' . $id . ' has been created.');
@@ -580,7 +580,7 @@ public function testLinkSeparateFormatter() {
"{$field_name}[2][uri]" => $url3,
"{$field_name}[2][title]" => $title3,
];
- $this->drupalPostForm(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, 'Save');
preg_match('|entity_test/manage/(\d+)|', $this->getUrl(), $match);
$id = $match[1];
$this->assertText('entity_test ' . $id . ' has been created.');
@@ -797,7 +797,7 @@ public function testNoLinkUri() {
"{$field_name}[0][uri]" => '
',
];
- $this->drupalPostForm('/entity_test/add', $edit, t('Save'));
+ $this->drupalPostForm('/entity_test/add', $edit, 'Save');
preg_match('|entity_test/manage/(\d+)|', $this->getUrl(), $match);
$id = $match[1];
$output = $this->renderTestEntity($id);
@@ -810,7 +810,7 @@ public function testNoLinkUri() {
"{$field_name}[0][uri]" => '',
];
- $this->drupalPostForm('/entity_test/add', $edit, t('Save'));
+ $this->drupalPostForm('/entity_test/add', $edit, 'Save');
preg_match('|entity_test/manage/(\d+)|', $this->getUrl(), $match);
$id = $match[1];
$output = $this->renderTestEntity($id);
diff --git a/core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php
index dfce03cebc03a311045c08a0c5ad7ac7b12c2c86..ae5a7f8675398503cfaf861ef1dc354fbdc2e82d 100644
--- a/core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationImportTest.php
@@ -64,7 +64,7 @@ public function testConfigTranslationImport() {
$edit = [
'authenticated[translate interface]' => 'translate interface',
];
- $this->drupalPostForm('admin/people/permissions', $edit, t('Save permissions'));
+ $this->drupalPostForm('admin/people/permissions', $edit, 'Save permissions');
// Check and update the translation status. This will import the Afrikaans
// translations of locale_test_translate module.
@@ -76,7 +76,7 @@ public function testConfigTranslationImport() {
$status['drupal']['af']->type = 'current';
\Drupal::state()->set('locale.translation_status', $status);
- $this->drupalPostForm('admin/reports/translations', [], t('Update translations'));
+ $this->drupalPostForm('admin/reports/translations', [], 'Update translations');
// Check if configuration translations have been imported.
$override = \Drupal::languageManager()->getLanguageConfigOverride('af', 'system.maintenance');
@@ -115,7 +115,7 @@ public function testConfigTranslationModuleInstall() {
->save();
// Add predefined language.
- $this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'af'], t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'af'], 'Add language');
// Add the system branding block to the page.
$this->drupalPlaceBlock('system_branding_block', ['region' => 'header', 'id' => 'site-branding']);
@@ -137,7 +137,7 @@ public function testConfigTranslationModuleInstall() {
->save();
// Install any module.
- $this->drupalPostForm('admin/modules', ['modules[dblog][enable]' => 'dblog'], t('Install'));
+ $this->drupalPostForm('admin/modules', ['modules[dblog][enable]' => 'dblog'], 'Install');
$this->assertText('Module Database Logging has been enabled.');
// Get the front page and ensure that the translated configuration still
@@ -181,7 +181,7 @@ public function testLocaleRemovalAndConfigOverrideDelete() {
->save();
// Add predefined language.
- $this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'af'], t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'af'], 'Add language');
$override = \Drupal::languageManager()->getLanguageConfigOverride('af', 'locale_test_translate.settings');
$this->assertEqual(['translatable_default_with_translation' => 'Locale can translate Afrikaans'], $override->get());
@@ -226,7 +226,7 @@ public function testLocaleRemovalAndConfigOverridePreserve() {
->save();
// Add predefined language.
- $this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'af'], t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'af'], 'Add language');
$override = \Drupal::languageManager()->getLanguageConfigOverride('af', 'locale_test_translate.settings');
// Update test configuration.
@@ -247,14 +247,14 @@ public function testLocaleRemovalAndConfigOverridePreserve() {
'langcode' => 'af',
'translation' => 'all',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$textareas = $this->xpath('//textarea');
$textarea = current($textareas);
$lid = $textarea->getAttribute('name');
$edit = [
$lid => '',
];
- $this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations'));
+ $this->drupalPostForm('admin/config/regional/translate', $edit, 'Save translations');
$override = \Drupal::languageManager()->getLanguageConfigOverride('af', 'locale_test_translate.settings');
$expected = [
diff --git a/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php
index ad34d676b23598b77f33f22b9a6f3d8d6481d81d..bf262a77b2bb14bae0d790d3a53c92ca94513df3 100644
--- a/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleConfigTranslationTest.php
@@ -65,10 +65,10 @@ protected function setUp(): void {
'label' => $name,
'direction' => LanguageInterface::DIRECTION_LTR,
];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add custom language');
// Set path prefix.
$edit = ["prefix[$this->langcode]" => $this->langcode];
- $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, 'Save configuration');
}
/**
@@ -87,14 +87,14 @@ public function testConfigTranslation() {
'langcode' => $this->langcode,
'translation' => 'all',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$textareas = $this->xpath('//textarea');
$textarea = current($textareas);
$lid = $textarea->getAttribute('name');
$edit = [
$lid => $message,
];
- $this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations'));
+ $this->drupalPostForm('admin/config/regional/translate', $edit, 'Save translations');
// Get translation and check we've only got the message.
$translation = \Drupal::languageManager()->getLanguageConfigOverride($this->langcode, 'system.maintenance')->get();
@@ -111,14 +111,14 @@ public function testConfigTranslation() {
'langcode' => $this->langcode,
'translation' => 'all',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$textareas = $this->xpath('//textarea');
$textarea = current($textareas);
$lid = $textarea->getAttribute('name');
$edit = [
$lid => 'D',
];
- $this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations'));
+ $this->drupalPostForm('admin/config/regional/translate', $edit, 'Save translations');
$translation = \Drupal::languageManager()->getLanguageConfigOverride($this->langcode, 'core.date_format.medium')->get();
$this->assertEqual($translation['pattern'], 'D', 'Got the right date format pattern after translation.');
@@ -133,7 +133,7 @@ public function testConfigTranslation() {
$this->assertNull($string, 'Configuration strings have been created upon installation.');
// Enable the image module.
- $this->drupalPostForm('admin/modules', ['modules[image][enable]' => "1"], t('Install'));
+ $this->drupalPostForm('admin/modules', ['modules[image][enable]' => "1"], 'Install');
$this->rebuildContainer();
$string = $this->storage->findString(['source' => 'Medium (220×220)', 'context' => '', 'type' => 'configuration']);
@@ -157,13 +157,13 @@ public function testConfigTranslation() {
'langcode' => $this->langcode,
'translation' => 'all',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$textarea = current($this->xpath('//textarea'));
$lid = $textarea->getAttribute('name');
$edit = [
$lid => $image_style_label,
];
- $this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations'));
+ $this->drupalPostForm('admin/config/regional/translate', $edit, 'Save translations');
// Check the right single translation has been created.
$translations = $this->storage->getTranslations(['language' => $this->langcode, 'type' => 'configuration', 'name' => 'image.style.medium']);
@@ -177,8 +177,8 @@ public function testConfigTranslation() {
$this->assertEqual($translation['label'], $image_style_label, 'Got the right translation for image style name after translation');
// Uninstall the module.
- $this->drupalPostForm('admin/modules/uninstall', ['uninstall[image]' => "image"], t('Uninstall'));
- $this->drupalPostForm(NULL, [], t('Uninstall'));
+ $this->drupalPostForm('admin/modules/uninstall', ['uninstall[image]' => "image"], 'Uninstall');
+ $this->drupalPostForm(NULL, [], 'Uninstall');
// Ensure that the translated configuration has been removed.
$override = \Drupal::languageManager()->getLanguageConfigOverride('xx', 'image.style.medium');
@@ -191,13 +191,13 @@ public function testConfigTranslation() {
'langcode' => $this->langcode,
'translation' => 'all',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$textarea = current($this->xpath('//textarea'));
$lid = $textarea->getAttribute('name');
$edit = [
$lid => $category_label,
];
- $this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations'));
+ $this->drupalPostForm('admin/config/regional/translate', $edit, 'Save translations');
// Check if this category displayed in this language will use the
// translation. This test ensures the entity loaded from the request
@@ -216,12 +216,12 @@ public function testConfigTranslation() {
public function testOptionalConfiguration() {
$this->assertNodeConfig(FALSE, FALSE);
// Enable the node module.
- $this->drupalPostForm('admin/modules', ['modules[node][enable]' => "1"], t('Install'));
- $this->drupalPostForm(NULL, [], t('Continue'));
+ $this->drupalPostForm('admin/modules', ['modules[node][enable]' => "1"], 'Install');
+ $this->drupalPostForm(NULL, [], 'Continue');
$this->rebuildContainer();
$this->assertNodeConfig(TRUE, FALSE);
// Enable the views module (which node provides some optional config for).
- $this->drupalPostForm('admin/modules', ['modules[views][enable]' => "1"], t('Install'));
+ $this->drupalPostForm('admin/modules', ['modules[views][enable]' => "1"], 'Install');
$this->rebuildContainer();
$this->assertNodeConfig(TRUE, TRUE);
}
diff --git a/core/modules/locale/tests/src/Functional/LocaleContentTest.php b/core/modules/locale/tests/src/Functional/LocaleContentTest.php
index 743f518d7b6cee284049e1bb2af125eb3b286df7..b0c8ada3247a8996c3e78e69f4abf443a289d567 100644
--- a/core/modules/locale/tests/src/Functional/LocaleContentTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleContentTest.php
@@ -49,12 +49,12 @@ public function testMachineNameLTR() {
// Install the Arabic language (which is RTL) and configure as the default.
$edit = [];
$edit['predefined_langcode'] = 'ar';
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language');
$edit = [
'site_default_language' => 'ar',
];
- $this->drupalPostForm('admin/config/regional/language', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/language', $edit, 'Save configuration');
// Verify that the machine name field is still LTR for a new content type.
$this->drupalGet('admin/structure/types/add');
@@ -94,7 +94,7 @@ public function testContentTypeLanguageConfiguration() {
'label' => $name,
'direction' => LanguageInterface::DIRECTION_LTR,
];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add custom language');
// Set the content type to use multilingual support.
$this->drupalGet("admin/structure/types/manage/{$type2->id()}");
@@ -102,7 +102,7 @@ public function testContentTypeLanguageConfiguration() {
$edit = [
'language_configuration[language_alterable]' => TRUE,
];
- $this->drupalPostForm("admin/structure/types/manage/{$type2->id()}", $edit, t('Save content type'));
+ $this->drupalPostForm("admin/structure/types/manage/{$type2->id()}", $edit, 'Save content type');
$this->assertRaw(t('The content type %type has been updated.', ['%type' => $type2->label()]));
$this->drupalLogout();
\Drupal::languageManager()->reset();
@@ -138,7 +138,7 @@ public function testContentTypeLanguageConfiguration() {
$edit = [
'langcode[0][value]' => 'en',
];
- $this->drupalPostForm($path, $edit, t('Save'));
+ $this->drupalPostForm($path, $edit, 'Save');
$this->assertText($node_title . ' has been updated.');
// Verify that the creation message contains a link to a node.
@@ -174,12 +174,12 @@ public function testContentTypeDirLang() {
// Install Arabic language.
$edit = [];
$edit['predefined_langcode'] = 'ar';
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language');
// Install Spanish language.
$edit = [];
$edit['predefined_langcode'] = 'es';
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language');
\Drupal::languageManager()->reset();
// Set the content type to use multilingual support.
@@ -187,7 +187,7 @@ public function testContentTypeDirLang() {
$edit = [
'language_configuration[language_alterable]' => TRUE,
];
- $this->drupalPostForm("admin/structure/types/manage/{$type->id()}", $edit, t('Save content type'));
+ $this->drupalPostForm("admin/structure/types/manage/{$type->id()}", $edit, 'Save content type');
$this->assertRaw(t('The content type %type has been updated.', ['%type' => $type->label()]));
$this->drupalLogout();
diff --git a/core/modules/locale/tests/src/Functional/LocaleExportTest.php b/core/modules/locale/tests/src/Functional/LocaleExportTest.php
index e6412c385382332f48c91ec63dafc63912d81ec7..26908ed15c23eea854b5457db790886183367bd2 100644
--- a/core/modules/locale/tests/src/Functional/LocaleExportTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleExportTest.php
@@ -59,13 +59,13 @@ public function testExportTranslation() {
$this->drupalPostForm('admin/config/regional/translate/import', [
'langcode' => 'fr',
'files[file]' => $name,
- ], t('Import'));
+ ], 'Import');
$file_system->unlink($name);
// Get the French translations.
$this->drupalPostForm('admin/config/regional/translate/export', [
'langcode' => 'fr',
- ], t('Export'));
+ ], 'Export');
// Ensure we have a translation file.
$this->assertRaw('# French translation of Drupal');
@@ -79,7 +79,7 @@ public function testExportTranslation() {
'langcode' => 'fr',
'files[file]' => $name,
'customized' => 1,
- ], t('Import'));
+ ], 'Import');
$file_system->unlink($name);
// Create string without translation in the locales_source table.
@@ -95,7 +95,7 @@ public function testExportTranslation() {
'content_options[not_customized]' => FALSE,
'content_options[customized]' => TRUE,
'content_options[not_translated]' => FALSE,
- ], t('Export'));
+ ], 'Export');
// Ensure we have a translation file.
$this->assertRaw('# French translation of Drupal');
@@ -110,7 +110,7 @@ public function testExportTranslation() {
'content_options[not_customized]' => FALSE,
'content_options[customized]' => FALSE,
'content_options[not_translated]' => TRUE,
- ], t('Export'));
+ ], 'Export');
// Ensure we have a translation file.
$this->assertRaw('# French translation of Drupal');
@@ -129,7 +129,7 @@ public function testExportTranslationTemplateFile() {
// the locales_source table gets populated with something.
$this->drupalGet('admin/config/regional/language');
// Get the translation template file.
- $this->drupalPostForm('admin/config/regional/translate/export', [], t('Export'));
+ $this->drupalPostForm('admin/config/regional/translate/export', [], 'Export');
// Ensure we have a translation file.
$this->assertRaw('# LANGUAGE translation of PROJECT');
}
diff --git a/core/modules/locale/tests/src/Functional/LocaleFileSystemFormTest.php b/core/modules/locale/tests/src/Functional/LocaleFileSystemFormTest.php
index 0298cd636a8b770917359233d622cebddb957352..361194c27de94ea0ab1182c04abbaa2fad6bd88c 100644
--- a/core/modules/locale/tests/src/Functional/LocaleFileSystemFormTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleFileSystemFormTest.php
@@ -52,7 +52,7 @@ public function testFileConfigurationPage() {
$fields = [
'translation_path' => $translation_path,
];
- $this->drupalPostForm(NULL, $fields, t('Save configuration'));
+ $this->drupalPostForm(NULL, $fields, 'Save configuration');
$this->drupalGet('admin/config/media/file-system');
$this->assertSession()->fieldValueEquals('translation_path', $translation_path);
$this->assertEqual($translation_path, $this->config('locale.settings')->get('translation.path'));
diff --git a/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php b/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php
index 7bab05decc793d84bdcab337750316e683c5e874..4257fd1a664d096f870f0088340389593ebc0dfe 100644
--- a/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php
@@ -145,7 +145,7 @@ public function testStandalonePoFile() {
$this->drupalPostForm('admin/config/regional/translate/import', [
'langcode' => 'fr',
'files[file]' => $name,
- ], t('Import'));
+ ], 'Import');
$this->assertSession()->addressEquals(Url::fromRoute('locale.translate_import'));
$this->assertText('File to import not found.', 'File to import not found message.');
@@ -163,7 +163,7 @@ public function testStandalonePoFile() {
'langcode' => 'fr',
'translation' => 'translated',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertText('No strings available.', 'String not overwritten by imported string.');
// This import should not have changed number of plural forms.
@@ -185,7 +185,7 @@ public function testStandalonePoFile() {
'langcode' => 'fr',
'translation' => 'translated',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertNoText('No strings available.', 'String overwritten by imported string.');
// This import should have changed number of plural forms.
$locale_plurals = \Drupal::service('locale.plural.formula')->reset()->getNumberOfPlurals('fr');
@@ -225,7 +225,7 @@ public function testStandalonePoFile() {
'langcode' => 'fr',
'translation' => 'translated',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertText('No strings available.', 'Customized string not overwritten by imported string.');
// Try importing a .po file with overriding strings, and ensure existing
@@ -244,7 +244,7 @@ public function testStandalonePoFile() {
'langcode' => 'fr',
'translation' => 'translated',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertNoText('No strings available.', 'Customized string overwritten by imported string.');
}
@@ -291,7 +291,7 @@ public function testEmptyMsgstr() {
'langcode' => $langcode,
'translation' => 'untranslated',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertText($str, 'Search found the string as untranslated.');
}
@@ -324,7 +324,7 @@ public function testConfigPoFile() {
'label' => $this->randomMachineName(16),
'direction' => LanguageInterface::DIRECTION_LTR,
];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add custom language');
// Check for the source strings we are going to translate. Adding the
// custom language should have made the process to export configuration
@@ -347,7 +347,7 @@ public function testConfigPoFile() {
'langcode' => $langcode,
'translation' => 'all',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertText($config_string[1], new FormattableMarkup('Translation of @string found.', ['@string' => $config_string[0]]));
}
@@ -401,7 +401,7 @@ public function importPoFile($contents, array $options = []) {
$name = $file_system->tempnam('temporary://', "po_") . '.po';
file_put_contents($name, $contents);
$options['files[file]'] = $name;
- $this->drupalPostForm('admin/config/regional/translate/import', $options, t('Import'));
+ $this->drupalPostForm('admin/config/regional/translate/import', $options, 'Import');
$file_system->unlink($name);
}
diff --git a/core/modules/locale/tests/src/Functional/LocaleJavascriptTranslationTest.php b/core/modules/locale/tests/src/Functional/LocaleJavascriptTranslationTest.php
index 096cac3b2b85a6d3fe0eefa20f7813b9d7874ec6..5bbe572103ffaa617b82bdf1baf8d9badcb01c3e 100644
--- a/core/modules/locale/tests/src/Functional/LocaleJavascriptTranslationTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleJavascriptTranslationTest.php
@@ -136,11 +136,11 @@ public function testLocaleTranslationJsDependencies() {
'label' => $name,
'direction' => LanguageInterface::DIRECTION_LTR,
];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add custom language');
// Set path prefix.
$edit = ["prefix[$langcode]" => $prefix];
- $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, 'Save configuration');
// This forces locale.admin.js string sources to be imported, which contains
// the next translation.
@@ -155,9 +155,9 @@ public function testLocaleTranslationJsDependencies() {
]);
$string = $strings[0];
- $this->drupalPostForm(NULL, ['string' => 'Show description'], t('Filter'));
+ $this->drupalPostForm(NULL, ['string' => 'Show description'], 'Filter');
$edit = ['strings[' . $string->lid . '][translations][0]' => 'Mostrar descripcion'];
- $this->drupalPostForm(NULL, $edit, t('Save translations'));
+ $this->drupalPostForm(NULL, $edit, 'Save translations');
// Calculate the filename of the JS including the translations.
$js_translation_files = \Drupal::state()->get('locale.translation.javascript');
diff --git a/core/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php b/core/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php
index cd0c475f8c8ac9c093c99460371ece16ce6c1fbf..3636227b606f85be9e489df86b47c46d2f5e1cc6 100644
--- a/core/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleLocaleLookupTest.php
@@ -43,7 +43,7 @@ protected function setUp(): void {
*/
public function testCircularDependency() {
// Ensure that we can enable early_translation_test on a non-english site.
- $this->drupalPostForm('admin/modules', ['modules[early_translation_test][enable]' => TRUE], t('Install'));
+ $this->drupalPostForm('admin/modules', ['modules[early_translation_test][enable]' => TRUE], 'Install');
$this->assertSession()->statusCodeEquals(200);
}
diff --git a/core/modules/locale/tests/src/Functional/LocalePathTest.php b/core/modules/locale/tests/src/Functional/LocalePathTest.php
index 2054ddd1f726b5e963b3faca364181eb8bec44d4..9d7861233b4277e21a795f1d6042296f6ca0a990 100644
--- a/core/modules/locale/tests/src/Functional/LocalePathTest.php
+++ b/core/modules/locale/tests/src/Functional/LocalePathTest.php
@@ -67,11 +67,11 @@ public function testPathLanguageConfiguration() {
'label' => $name,
'direction' => LanguageInterface::DIRECTION_LTR,
];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add custom language');
// Set path prefix.
$edit = ["prefix[$langcode]" => $prefix];
- $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/language/detection/url', $edit, 'Save configuration');
// Check that the "xx" front page is readily available because path prefix
// negotiation is pre-configured.
@@ -89,7 +89,7 @@ public function testPathLanguageConfiguration() {
'alias[0][value]' => '/' . $english_path,
'langcode[0][value]' => 'en',
];
- $this->drupalPostForm($path, $edit, t('Save'));
+ $this->drupalPostForm($path, $edit, 'Save');
// Create a path alias in new custom language.
$custom_language_path = $this->randomMachineName(8);
@@ -98,7 +98,7 @@ public function testPathLanguageConfiguration() {
'alias[0][value]' => '/' . $custom_language_path,
'langcode[0][value]' => $langcode,
];
- $this->drupalPostForm($path, $edit, t('Save'));
+ $this->drupalPostForm($path, $edit, 'Save');
// Confirm English language path alias works.
$this->drupalGet($english_path);
diff --git a/core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php b/core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php
index fad503dc383dd0b033650a975fd43514a834bda8..de620e2d89c46a68c6464c7c2284b5df9b4d196d 100644
--- a/core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php
+++ b/core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php
@@ -187,7 +187,7 @@ public function testPluralEditDateFormatter() {
// not break the test.
'translation' => 'translated',
];
- $this->drupalPostForm($path, $search, t('Filter'));
+ $this->drupalPostForm($path, $search, 'Filter');
// Plural values for the langcode fr.
$this->assertText('@count seconde');
$this->assertText('@count secondes');
@@ -208,14 +208,14 @@ public function testPluralEditDateFormatter() {
'string' => '1 second',
'langcode' => 'fr',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
// Save complete translations for the string in langcode fr.
$edit = [
"strings[$lid][translations][0]" => '1 seconde updated',
"strings[$lid][translations][1]" => '@count secondes updated',
];
- $this->drupalPostForm($path, $edit, t('Save translations'));
+ $this->drupalPostForm($path, $edit, 'Save translations');
// User interface input for translating seconds should not be duplicated
$this->assertSession()->pageTextContainsOnce('@count seconds');
@@ -244,7 +244,7 @@ public function testPluralEditExport() {
// Get the French translations.
$this->drupalPostForm('admin/config/regional/translate/export', [
'langcode' => 'fr',
- ], t('Export'));
+ ], 'Export');
// Ensure we have a translation file.
$this->assertRaw('# French translation of Drupal');
// Ensure our imported translations exist in the file.
@@ -255,7 +255,7 @@ public function testPluralEditExport() {
// Get the Croatian translations.
$this->drupalPostForm('admin/config/regional/translate/export', [
'langcode' => 'hr',
- ], t('Export'));
+ ], 'Export');
// Ensure we have a translation file.
$this->assertRaw('# Croatian translation of Drupal');
// Ensure our imported translations exist in the file.
@@ -273,7 +273,7 @@ public function testPluralEditExport() {
$search = [
'langcode' => 'hr',
];
- $this->drupalPostForm($path, $search, t('Filter'));
+ $this->drupalPostForm($path, $search, 'Filter');
// Labels for plural editing elements.
$this->assertText('Singular form');
$this->assertText('First plural form');
@@ -296,12 +296,12 @@ public function testPluralEditExport() {
$edit = [
"strings[$lid][translations][1]" => '@count sata edited',
];
- $this->drupalPostForm($path, $edit, t('Save translations'));
+ $this->drupalPostForm($path, $edit, 'Save translations');
$search = [
'langcode' => 'fr',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
// Plural values for the langcode fr.
$this->assertText('@count heure');
$this->assertText('@count heures');
@@ -311,7 +311,7 @@ public function testPluralEditExport() {
$edit = [
"strings[$lid][translations][0]" => '@count heure edited',
];
- $this->drupalPostForm($path, $edit, t('Save translations'));
+ $this->drupalPostForm($path, $edit, 'Save translations');
// Inject a plural source string to the database. We need to use a specific
// langcode here because the language will be English by default and will
@@ -329,33 +329,33 @@ public function testPluralEditExport() {
'string' => '1 day',
'langcode' => 'fr',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
// Save complete translations for the string in langcode fr.
$edit = [
"strings[$lid][translations][0]" => '1 jour',
"strings[$lid][translations][1]" => '@count jours',
];
- $this->drupalPostForm($path, $edit, t('Save translations'));
+ $this->drupalPostForm($path, $edit, 'Save translations');
// Save complete translations for the string in langcode hr.
$search = [
'string' => '1 day',
'langcode' => 'hr',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$edit = [
"strings[$lid][translations][0]" => '@count dan',
"strings[$lid][translations][1]" => '@count dana',
"strings[$lid][translations][2]" => '@count dana',
];
- $this->drupalPostForm($path, $edit, t('Save translations'));
+ $this->drupalPostForm($path, $edit, 'Save translations');
// Get the French translations.
$this->drupalPostForm('admin/config/regional/translate/export', [
'langcode' => 'fr',
- ], t('Export'));
+ ], 'Export');
// Check for plural export specifically.
$this->assertRaw("msgid \"1 hour\"\nmsgid_plural \"@count hours\"\nmsgstr[0] \"@count heure edited\"\nmsgstr[1] \"@count heures\"");
$this->assertRaw("msgid \"1 day\"\nmsgid_plural \"@count days\"\nmsgstr[0] \"1 jour\"\nmsgstr[1] \"@count jours\"");
@@ -363,7 +363,7 @@ public function testPluralEditExport() {
// Get the Croatian translations.
$this->drupalPostForm('admin/config/regional/translate/export', [
'langcode' => 'hr',
- ], t('Export'));
+ ], 'Export');
// Check for plural export specifically.
$this->assertRaw("msgid \"1 hour\"\nmsgid_plural \"@count hours\"\nmsgstr[0] \"@count sat\"\nmsgstr[1] \"@count sata edited\"\nmsgstr[2] \"@count sati\"");
$this->assertRaw("msgid \"1 day\"\nmsgid_plural \"@count days\"\nmsgstr[0] \"@count dan\"\nmsgstr[1] \"@count dana\"\nmsgstr[2] \"@count dana\"");
@@ -382,7 +382,7 @@ public function importPoFile($contents, array $options = []) {
$name = $file_system->tempnam('temporary://', "po_") . '.po';
file_put_contents($name, $contents);
$options['files[file]'] = $name;
- $this->drupalPostForm('admin/config/regional/translate/import', $options, t('Import'));
+ $this->drupalPostForm('admin/config/regional/translate/import', $options, 'Import');
$file_system->unlink($name);
}
diff --git a/core/modules/locale/tests/src/Functional/LocaleTranslateStringTourTest.php b/core/modules/locale/tests/src/Functional/LocaleTranslateStringTourTest.php
index 3ffe9e40a342039e9dc25935ece1a8d84a802b48..9e209c5159f6b30f2dc2e715482857544086a3a5 100644
--- a/core/modules/locale/tests/src/Functional/LocaleTranslateStringTourTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleTranslateStringTourTest.php
@@ -50,7 +50,7 @@ public function testTranslateStringTourTips() {
// Add another language so there are no missing form items.
$edit = [];
$edit['predefined_langcode'] = 'es';
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language');
$this->drupalGet('admin/config/regional/translate');
$this->assertTourTips();
diff --git a/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php b/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php
index 5c5c763883f82c2229808bc3fa1bed4a088ffc23..5dd2d33a0fba9ac3da05dc8f59c03410a47b6a00 100644
--- a/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php
@@ -38,7 +38,7 @@ public function testEnglishTranslation() {
]);
$this->drupalLogin($admin_user);
- $this->drupalPostForm('admin/config/regional/language/edit/en', ['locale_translate_english' => TRUE], t('Save language'));
+ $this->drupalPostForm('admin/config/regional/language/edit/en', ['locale_translate_english' => TRUE], 'Save language');
$this->assertSession()->linkByHrefExists('/admin/config/regional/translate?langcode=en', 0, 'Enabled interface translation to English.');
}
@@ -72,7 +72,7 @@ public function testStringTranslation() {
'label' => $name,
'direction' => LanguageInterface::DIRECTION_LTR,
];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add custom language');
// Add string.
t($name, [], ['langcode' => $langcode])->render();
// Reset locale cache.
@@ -91,7 +91,7 @@ public function testStringTranslation() {
'langcode' => $langcode,
'translation' => 'untranslated',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertText($name, 'Search found the string as untranslated.');
// No t() here, it's surely not translated yet.
@@ -100,10 +100,10 @@ public function testStringTranslation() {
$this->assertSession()->optionNotExists('edit-langcode', 'en');
$this->drupalLogout();
$this->drupalLogin($admin_user);
- $this->drupalPostForm('admin/config/regional/language/edit/en', ['locale_translate_english' => TRUE], t('Save language'));
+ $this->drupalPostForm('admin/config/regional/language/edit/en', ['locale_translate_english' => TRUE], 'Save language');
$this->drupalLogout();
$this->drupalLogin($translate_user);
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertText($name, 'Search found the string as untranslated.');
// Assume this is the only result, given the random name.
@@ -112,7 +112,7 @@ public function testStringTranslation() {
$edit = [
$lid => $translation,
];
- $this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations'));
+ $this->drupalPostForm('admin/config/regional/translate', $edit, 'Save translations');
$this->assertText('The strings have been saved.', 'The strings have been saved.');
$url_bits = explode('?', $this->getUrl());
$this->assertEqual($url_bits[0], Url::fromRoute('locale.translate_page', [], ['absolute' => TRUE])->toString(), 'Correct page redirection.');
@@ -121,7 +121,7 @@ public function testStringTranslation() {
'langcode' => $langcode,
'translation' => 'translated',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertRaw($translation);
$search = [
@@ -129,19 +129,19 @@ public function testStringTranslation() {
'langcode' => 'en',
'translation' => 'untranslated',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$textarea = current($this->xpath('//textarea'));
$lid = $textarea->getAttribute('name');
$edit = [
$lid => $translation_to_en,
];
- $this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations'));
+ $this->drupalPostForm('admin/config/regional/translate', $edit, 'Save translations');
$search = [
'string' => $name,
'langcode' => 'en',
'translation' => 'translated',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertRaw($translation_to_en);
$this->assertNotEquals($translation, $name);
@@ -160,7 +160,7 @@ public function testStringTranslation() {
'langcode' => 'en',
'translation' => 'untranslated',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertText('No strings available.', 'String is translated.');
// Test invalidation of 'rendered' cache tag after string translation.
@@ -174,13 +174,13 @@ public function testStringTranslation() {
'langcode' => $langcode,
'translation' => 'untranslated',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$textarea = current($this->xpath('//textarea'));
$lid = $textarea->getAttribute('name');
$edit = [
$lid => 'Please enter your Llama username.',
];
- $this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations'));
+ $this->drupalPostForm('admin/config/regional/translate', $edit, 'Save translations');
$this->drupalLogout();
$this->drupalGet('xx/user/login');
@@ -190,7 +190,7 @@ public function testStringTranslation() {
$this->drupalLogin($admin_user);
$path = 'admin/config/regional/language/delete/' . $langcode;
// This a confirm form, we do not need any fields changed.
- $this->drupalPostForm($path, [], t('Delete'));
+ $this->drupalPostForm($path, [], 'Delete');
// We need raw here because %language and %langcode will add HTML.
$t_args = ['%language' => $name, '%langcode' => $langcode];
$this->assertRaw(t('The %language (%langcode) language has been removed.', $t_args));
@@ -207,14 +207,14 @@ public function testStringTranslation() {
'langcode' => 'en',
'translation' => 'translated',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
// Assume this is the only result, given the random name.
$textarea = current($this->xpath('//textarea'));
$lid = $textarea->getAttribute('name');
$edit = [
$lid => '',
];
- $this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations'));
+ $this->drupalPostForm('admin/config/regional/translate', $edit, 'Save translations');
$this->assertRaw($name);
$this->drupalLogin($translate_user);
$search = [
@@ -222,7 +222,7 @@ public function testStringTranslation() {
'langcode' => 'en',
'translation' => 'untranslated',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertNoText('No strings available.', 'The translation has been removed');
}
@@ -250,7 +250,7 @@ public function testJavaScriptTranslation() {
'label' => $name,
'direction' => LanguageInterface::DIRECTION_LTR,
];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add custom language');
$this->container->get('language_manager')->reset();
// Build the JavaScript translation file.
@@ -270,14 +270,14 @@ public function testJavaScriptTranslation() {
'langcode' => $langcode,
'translation' => 'all',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$textarea = current($this->xpath('//textarea'));
$lid = $textarea->getAttribute('name');
$edit = [
$lid => $this->randomMachineName(),
];
- $this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations'));
+ $this->drupalPostForm('admin/config/regional/translate', $edit, 'Save translations');
// Trigger JavaScript translation parsing and building.
_locale_rebuild_js($langcode);
@@ -325,7 +325,7 @@ public function testStringValidation() {
'label' => $name,
'direction' => LanguageInterface::DIRECTION_LTR,
];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add custom language');
// Add string.
t($name, [], ['langcode' => $langcode])->render();
// Reset locale cache.
@@ -334,7 +334,7 @@ public function testStringValidation() {
'langcode' => $langcode,
'translation' => 'all',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
// Find the edit path.
$textarea = current($this->xpath('//textarea'));
@@ -343,7 +343,7 @@ public function testStringValidation() {
$edit = [
$lid => $translation,
];
- $this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations'));
+ $this->drupalPostForm('admin/config/regional/translate', $edit, 'Save translations');
// Check for a form error on the textarea.
$form_class = $this->xpath('//form[@id="locale-translate-edit-form"]//textarea/@class');
$this->assertStringContainsString('error', $form_class[0]->getText(), 'The string was rejected as unsafe.');
@@ -381,7 +381,7 @@ public function testStringSearch() {
'label' => $name,
'direction' => LanguageInterface::DIRECTION_LTR,
];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add custom language');
$edit = [
'predefined_langcode' => 'custom',
@@ -389,7 +389,7 @@ public function testStringSearch() {
'label' => $this->randomMachineName(16),
'direction' => LanguageInterface::DIRECTION_LTR,
];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add custom language');
// Add string.
t($name, [], ['langcode' => $langcode])->render();
@@ -404,7 +404,7 @@ public function testStringSearch() {
'langcode' => $langcode,
'translation' => 'all',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
// assertText() seems to remove the input field where $name always could be
// found, so this is not a false assert. See how assertNoText succeeds
// later.
@@ -417,7 +417,7 @@ public function testStringSearch() {
'langcode' => $langcode,
'translation' => 'translated',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertText('No strings available.', "Search didn't find the string.");
// Ensure untranslated string appears if searching on 'only untranslated
@@ -427,7 +427,7 @@ public function testStringSearch() {
'langcode' => $langcode,
'translation' => 'untranslated',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertNoText('No strings available.', 'Search found the string.');
// Add translation.
@@ -438,7 +438,7 @@ public function testStringSearch() {
$edit = [
$lid => $translation,
];
- $this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations'));
+ $this->drupalPostForm('admin/config/regional/translate', $edit, 'Save translations');
// Ensure translated string does appear if searching on 'only
// translated strings'.
@@ -447,7 +447,7 @@ public function testStringSearch() {
'langcode' => $langcode,
'translation' => 'translated',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertNoText('No strings available.', 'Search found the translation.');
// Ensure translated source string doesn't appear if searching on 'only
@@ -457,7 +457,7 @@ public function testStringSearch() {
'langcode' => $langcode,
'translation' => 'untranslated',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertText('No strings available.', "Search didn't find the source string.");
// Ensure translated string doesn't appear if searching on 'only
@@ -467,7 +467,7 @@ public function testStringSearch() {
'langcode' => $langcode,
'translation' => 'untranslated',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertText('No strings available.', "Search didn't find the translation.");
// Ensure translated string does appear if searching on the custom language.
@@ -476,7 +476,7 @@ public function testStringSearch() {
'langcode' => $langcode,
'translation' => 'all',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertNoText('No strings available.', 'Search found the translation.');
// Ensure translated string doesn't appear if searching in System (English).
@@ -485,7 +485,7 @@ public function testStringSearch() {
'langcode' => 'yy',
'translation' => 'all',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertText('No strings available.', "Search didn't find the translation.");
// Search for a string that isn't in the system.
@@ -495,7 +495,7 @@ public function testStringSearch() {
'langcode' => $langcode,
'translation' => 'all',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertText('No strings available.', "Search didn't find the invalid string.");
}
@@ -536,7 +536,7 @@ public function testUICustomizedStrings() {
'translation' => 'translated',
'customized' => '0',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertText($translation->getString(), 'Translation is found in search result.');
@@ -546,7 +546,7 @@ public function testUICustomizedStrings() {
$edit = [
$lid => $translation->getString(),
];
- $this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations'));
+ $this->drupalPostForm('admin/config/regional/translate', $edit, 'Save translations');
// Ensure unchanged translation string does appear if searching
// non-customized translation.
@@ -556,7 +556,7 @@ public function testUICustomizedStrings() {
'translation' => 'translated',
'customized' => '0',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertText($string->getString(), 'Translation is not marked as customized.');
// Submit the translations with a new translation.
@@ -565,7 +565,7 @@ public function testUICustomizedStrings() {
$edit = [
$lid => $this->randomMachineName(100),
];
- $this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations'));
+ $this->drupalPostForm('admin/config/regional/translate', $edit, 'Save translations');
// Ensure changed translation string does appear if searching customized
// translation.
@@ -575,7 +575,7 @@ public function testUICustomizedStrings() {
'translation' => 'translated',
'customized' => '1',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertText($string->getString(), "Translation is marked as customized.");
}
diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php b/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php
index 359a9ad5bd70ae9c14439a32342d179f617a2fb4..7da4ab4c6ac0c7eaf3f3833245e5c522ed1817bf 100644
--- a/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php
+++ b/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php
@@ -89,7 +89,7 @@ protected function setTranslationsDirectory($path) {
*/
protected function addLanguage($langcode) {
$edit = ['predefined_langcode' => $langcode];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language');
$this->container->get('language_manager')->reset();
$this->assertNotEmpty(\Drupal::languageManager()->getLanguage($langcode), new FormattableMarkup('Language %langcode added.', ['%langcode' => $langcode]));
}
diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php b/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php
index b7bef2392a3012e94e5c6931f5374957ca874c72..37dcf4b2fba8b657ca63ce4afd84b3106ce2d615 100644
--- a/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php
@@ -51,7 +51,7 @@ public function testUpdateCron() {
// Update translations using batch to ensure a clean test starting point.
$this->drupalGet('admin/reports/translations/check');
- $this->drupalPostForm('admin/reports/translations', [], t('Update translations'));
+ $this->drupalPostForm('admin/reports/translations', [], 'Update translations');
// Store translation status for comparison.
$initial_history = locale_translation_get_file_history();
@@ -74,7 +74,7 @@ public function testUpdateCron() {
$edit = [
'update_interval_days' => 0,
];
- $this->drupalPostForm('admin/config/regional/translate/settings', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/translate/settings', $edit, 'Save configuration');
// Execute locale cron tasks to add tasks to the queue.
locale_cron();
@@ -89,7 +89,7 @@ public function testUpdateCron() {
$edit = [
'update_interval_days' => 7,
];
- $this->drupalPostForm('admin/config/regional/translate/settings', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/translate/settings', $edit, 'Save configuration');
// Execute locale cron tasks to add tasks to the queue.
locale_cron();
diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateDevelopmentReleaseTest.php b/core/modules/locale/tests/src/Functional/LocaleUpdateDevelopmentReleaseTest.php
index 536c4fd4275dd475f9ee54395343266c02987f81..bbe70ce76ad039bb3c41effba731553ebae12374 100644
--- a/core/modules/locale/tests/src/Functional/LocaleUpdateDevelopmentReleaseTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleUpdateDevelopmentReleaseTest.php
@@ -28,7 +28,7 @@ protected function setUp(): void {
'translate interface',
]);
$this->drupalLogin($admin_user);
- $this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'hu'], t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', ['predefined_langcode' => 'hu'], 'Add language');
}
public function testLocaleUpdateDevelopmentRelease() {
diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php b/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php
index 8de98d95d195a710e92b905431b56e2c485611e1..5552c1c2c4bc383fa72537043a1e7966fb5fe38b 100644
--- a/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php
@@ -70,7 +70,7 @@ public function testUpdateCheckStatus() {
$edit = [
'use_source' => LOCALE_TRANSLATION_USE_SOURCE_LOCAL,
];
- $this->drupalPostForm('admin/config/regional/translate/settings', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/translate/settings', $edit, 'Save configuration');
// Get status of translation sources at local file system.
$this->drupalGet('admin/reports/translations/check');
@@ -86,7 +86,7 @@ public function testUpdateCheckStatus() {
$edit = [
'use_source' => LOCALE_TRANSLATION_USE_SOURCE_REMOTE_AND_LOCAL,
];
- $this->drupalPostForm('admin/config/regional/translate/settings', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/translate/settings', $edit, 'Save configuration');
// Get status of translation sources at both local and remote locations.
$this->drupalGet('admin/reports/translations/check');
@@ -121,7 +121,7 @@ public function testUpdateImportSourceRemote() {
'use_source' => LOCALE_TRANSLATION_USE_SOURCE_REMOTE_AND_LOCAL,
'overwrite' => LOCALE_TRANSLATION_OVERWRITE_ALL,
];
- $this->drupalPostForm('admin/config/regional/translate/settings', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/translate/settings', $edit, 'Save configuration');
// Get the translation status.
$this->drupalGet('admin/reports/translations/check');
@@ -135,7 +135,7 @@ public function testUpdateImportSourceRemote() {
$this->assertText('Contributed module two (' . $date_formatter->format($this->timestampNew, 'html_date') . ')', 'Updates for Contrib module two');
// Execute the translation update.
- $this->drupalPostForm('admin/reports/translations', [], t('Update translations'));
+ $this->drupalPostForm('admin/reports/translations', [], 'Update translations');
// Check if the translation has been updated, using the status cache.
$status = locale_translation_get_status();
@@ -187,11 +187,11 @@ public function testUpdateImportSourceLocal() {
'use_source' => LOCALE_TRANSLATION_USE_SOURCE_LOCAL,
'overwrite' => LOCALE_TRANSLATION_OVERWRITE_ALL,
];
- $this->drupalPostForm('admin/config/regional/translate/settings', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/translate/settings', $edit, 'Save configuration');
// Execute the translation update.
$this->drupalGet('admin/reports/translations/check');
- $this->drupalPostForm('admin/reports/translations', [], t('Update translations'));
+ $this->drupalPostForm('admin/reports/translations', [], 'Update translations');
// Check if the translation has been updated, using the status cache.
$status = locale_translation_get_status();
@@ -243,11 +243,11 @@ public function testUpdateImportModeNonCustomized() {
'use_source' => LOCALE_TRANSLATION_USE_SOURCE_REMOTE_AND_LOCAL,
'overwrite' => LOCALE_TRANSLATION_OVERWRITE_NON_CUSTOMIZED,
];
- $this->drupalPostForm('admin/config/regional/translate/settings', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/translate/settings', $edit, 'Save configuration');
// Execute translation update.
$this->drupalGet('admin/reports/translations/check');
- $this->drupalPostForm('admin/reports/translations', [], t('Update translations'));
+ $this->drupalPostForm('admin/reports/translations', [], 'Update translations');
// Check whether existing translations have (not) been overwritten.
// cSpell:disable
@@ -281,11 +281,11 @@ public function testUpdateImportModeNone() {
'use_source' => LOCALE_TRANSLATION_USE_SOURCE_REMOTE_AND_LOCAL,
'overwrite' => LOCALE_TRANSLATION_OVERWRITE_NONE,
];
- $this->drupalPostForm('admin/config/regional/translate/settings', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/translate/settings', $edit, 'Save configuration');
// Execute translation update.
$this->drupalGet('admin/reports/translations/check');
- $this->drupalPostForm('admin/reports/translations', [], t('Update translations'));
+ $this->drupalPostForm('admin/reports/translations', [], 'Update translations');
// Check whether existing translations have (not) been overwritten.
// cSpell:disable
@@ -313,7 +313,7 @@ public function testEnableUninstallModule() {
$edit = [
'modules[locale_test_translate][enable]' => 'locale_test_translate',
];
- $this->drupalPostForm('admin/modules', $edit, t('Install'));
+ $this->drupalPostForm('admin/modules', $edit, 'Install');
// Check if translations have been imported.
$this->assertRaw(t('One translation file imported. %number translations were added, %update translations were updated and %delete translations were removed.',
@@ -324,8 +324,8 @@ public function testEnableUninstallModule() {
$edit = [
'uninstall[locale_test_translate]' => 1,
];
- $this->drupalPostForm('admin/modules/uninstall', $edit, t('Uninstall'));
- $this->drupalPostForm(NULL, [], t('Uninstall'));
+ $this->drupalPostForm('admin/modules/uninstall', $edit, 'Uninstall');
+ $this->drupalPostForm(NULL, [], 'Uninstall');
// Check if the file data is removed from the database.
$history = locale_translation_get_file_history();
@@ -349,7 +349,7 @@ public function testEnableLanguage() {
$edit = [
'modules[locale_test_translate][enable]' => 'locale_test_translate',
];
- $this->drupalPostForm('admin/modules', $edit, t('Install'));
+ $this->drupalPostForm('admin/modules', $edit, 'Install');
// Check if there is no Dutch translation yet.
$this->assertTranslation('Extraday', '', 'nl');
@@ -360,7 +360,7 @@ public function testEnableLanguage() {
$edit = [
'predefined_langcode' => 'nl',
];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language');
// Check if the right number of translations are added.
$this->assertRaw(t('One translation file imported. %number translations were added, %update translations were updated and %delete translations were removed.',
@@ -378,7 +378,7 @@ public function testEnableLanguage() {
$this->assertNotEmpty($result, 'Files added to file history');
// Remove a language.
- $this->drupalPostForm('admin/config/regional/language/delete/nl', [], t('Delete'));
+ $this->drupalPostForm('admin/config/regional/language/delete/nl', [], 'Delete');
// Check if the language data is removed from the database.
$result = $connection->select('locale_file', 'lf')
@@ -405,7 +405,7 @@ public function testEnableCustomLanguage() {
$edit = [
'modules[locale_test_translate][enable]' => 'locale_test_translate',
];
- $this->drupalPostForm('admin/modules', $edit, t('Install'));
+ $this->drupalPostForm('admin/modules', $edit, 'Install');
// Create a custom language with language code 'xx' and a random
// name.
@@ -417,7 +417,7 @@ public function testEnableCustomLanguage() {
'label' => $name,
'direction' => LanguageInterface::DIRECTION_LTR,
];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
+ $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add custom language');
// Ensure the translation file is automatically imported when the language
// was added.
@@ -430,7 +430,7 @@ public function testEnableCustomLanguage() {
'langcode' => $langcode,
'translation' => 'translated',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertNoText('No strings available.', 'String successfully imported.');
// Ensure the multiline string was imported.
@@ -439,7 +439,7 @@ public function testEnableCustomLanguage() {
'langcode' => $langcode,
'translation' => 'all',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertText('Multiline translation string to make sure that import works with it.', 'String successfully imported.');
// Ensure 'Allowed HTML source string' was imported but the translation for
@@ -450,7 +450,7 @@ public function testEnableCustomLanguage() {
'langcode' => $langcode,
'translation' => 'all',
];
- $this->drupalPostForm('admin/config/regional/translate', $search, t('Filter'));
+ $this->drupalPostForm('admin/config/regional/translate', $search, 'Filter');
$this->assertText('Allowed HTML source string', 'String successfully imported.');
$this->assertNoText('Another allowed HTML source string', 'String with disallowed translation not imported.');
}
diff --git a/core/modules/media_library/tests/src/Functional/MediaLibraryDisplayModeTest.php b/core/modules/media_library/tests/src/Functional/MediaLibraryDisplayModeTest.php
index 2d4c056f345eb1275e0365c365b0eeaf77587354..d6e8026eebe6a422372b4d173921362f9f123f82 100644
--- a/core/modules/media_library/tests/src/Functional/MediaLibraryDisplayModeTest.php
+++ b/core/modules/media_library/tests/src/Functional/MediaLibraryDisplayModeTest.php
@@ -112,7 +112,7 @@ public function testDisplayModes() {
'source' => 'file',
];
$this->drupalPostForm('admin/structure/media/add', $edit, 'Save');
- $this->drupalPostForm(NULL, [], t('Save'));
+ $this->drupalPostForm(NULL, [], 'Save');
$this->assertSession()->pageTextContains("Media Library form and view displays have been created for the $type_five_id media type.");
$this->assertFormDisplay($type_five_id, TRUE, FALSE);
$this->assertViewDisplay($type_five_id, 'medium');
@@ -128,7 +128,7 @@ public function testDisplayModes() {
$edit = [
'field_map[name]' => File::METADATA_ATTRIBUTE_NAME,
];
- $this->drupalPostForm(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, 'Save');
$this->assertSession()->pageTextContains("Media Library form and view displays have been created for the $type_six_id media type.");
$this->assertFormDisplay($type_six_id, FALSE, FALSE);
$this->assertViewDisplay($type_six_id, 'medium');
@@ -141,7 +141,7 @@ public function testDisplayModes() {
'source' => 'image',
];
$this->drupalPostForm('admin/structure/media/add', $edit, 'Save');
- $this->drupalPostForm(NULL, [], t('Save'));
+ $this->drupalPostForm(NULL, [], 'Save');
$this->assertSession()->pageTextContains("Media Library form and view displays have been created for the $type_seven_id media type.");
$this->assertFormDisplay($type_seven_id, TRUE, TRUE);
$this->assertViewDisplay($type_seven_id, 'medium');
@@ -157,7 +157,7 @@ public function testDisplayModes() {
$edit = [
'field_map[name]' => Image::METADATA_ATTRIBUTE_NAME,
];
- $this->drupalPostForm(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, 'Save');
$this->assertSession()->pageTextContains("Media Library form and view displays have been created for the $type_eight_id media type.");
$this->assertFormDisplay($type_eight_id, FALSE, TRUE);
$this->assertViewDisplay($type_eight_id, 'medium');
@@ -173,7 +173,7 @@ public function testDisplayModes() {
$edit = [
'field_map[title]' => 'name',
];
- $this->drupalPostForm(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, 'Save');
$this->assertSession()->pageTextContains("Media Library form and view displays have been created for the $type_id media type.");
$this->assertFormDisplay($type_id, FALSE, FALSE);
$this->assertViewDisplay($type_id, 'medium');
@@ -198,7 +198,7 @@ public function testDisplayModes() {
'source' => 'image',
];
$this->drupalPostForm('admin/structure/media/add', $edit, 'Save');
- $this->drupalPostForm(NULL, [], t('Save'));
+ $this->drupalPostForm(NULL, [], 'Save');
$this->assertSession()->pageTextContains("Media Library form and view displays have been created for the $type_nine_id media type.");
$this->assertFormDisplay($type_nine_id, TRUE, TRUE);
$this->assertViewDisplay($type_nine_id, 'media_library');
diff --git a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentDeleteFormTest.php b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentDeleteFormTest.php
index 7eb6681c2d3c428e037e2cc188a053774b107f02..e401c85c8b1a3b36bba385b2a7da69df4d085bb8 100644
--- a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentDeleteFormTest.php
+++ b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentDeleteFormTest.php
@@ -45,7 +45,7 @@ public function testMenuLinkContentDeleteForm() {
'title[0][value]' => t('Front page'),
'link[0][uri]' => '',
],
- t('Save')
+ 'Save'
);
$this->assertText('The menu link has been saved.');
@@ -62,7 +62,7 @@ public function testMenuLinkContentDeleteForm() {
$this->drupalGet($menu_link->toUrl('delete-form'));
$menu = Menu::load($menu_link->getMenuName());
$this->assertSession()->linkByHrefExists($menu->toUrl('edit-form')->toString());
- $this->drupalPostForm(NULL, [], t('Delete'));
+ $this->drupalPostForm(NULL, [], 'Delete');
$this->assertRaw(t('The menu link %title has been deleted.', ['%title' => $menu_link->label()]));
}
diff --git a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php
index d62ba91b63dba1d7af96e6b53dc28efc4fd2d60a..c3d85943645cd5591fd19addfc6348b17f6a83d5 100644
--- a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php
+++ b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php
@@ -95,7 +95,7 @@ public function testMenuLinkContentForm() {
'title[0][value]' => t('Front page'),
'link[0][uri]' => '',
],
- t('Save')
+ 'Save'
);
$this->assertText('The menu link has been saved.');
}
@@ -111,7 +111,7 @@ public function testMenuLinkContentFormValidation() {
'title[0][value]' => t('Test page'),
'link[0][uri]' => '',
],
- t('Save')
+ 'Save'
);
$this->assertText('Manually entered paths should start with one of the following characters: / ? #');
}
diff --git a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php
index 20eeb7a11320d52f45d3bb22089fdbafd94b46da..160c13c126911ff2f6d319e68c6d420b5813cd35 100644
--- a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php
+++ b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php
@@ -96,7 +96,7 @@ public function testTranslationLinkTheme() {
$this->container->get('theme_installer')->install(['seven']);
$edit = [];
$edit['admin_theme'] = 'seven';
- $this->drupalPostForm('admin/appearance', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/appearance', $edit, 'Save configuration');
// Check that edit uses the admin theme.
$this->drupalGet('admin/structure/menu/item/' . $entityId . '/edit');
$this->assertRaw('core/themes/seven/css/base/elements.css');
diff --git a/core/modules/menu_ui/tests/src/Functional/MenuLinkReorderTest.php b/core/modules/menu_ui/tests/src/Functional/MenuLinkReorderTest.php
index 734d53fd92babb058aff28d5f86a1f1e890f9fcf..76710fe908064e94f67d02b85983a2498ff6e6ca 100644
--- a/core/modules/menu_ui/tests/src/Functional/MenuLinkReorderTest.php
+++ b/core/modules/menu_ui/tests/src/Functional/MenuLinkReorderTest.php
@@ -54,14 +54,14 @@ public function testDefaultMenuLinkReorder() {
$edit = [
'links[menu_plugin_id:test_page_test.front_page][weight]' => -10,
];
- $this->drupalPostForm('admin/structure/menu/manage/main', $edit, t('Save'));
+ $this->drupalPostForm('admin/structure/menu/manage/main', $edit, 'Save');
// The link is still there.
$this->drupalGet('test-page');
$this->assertSession()->linkExists('Home');
// Clear all caches.
- $this->drupalPostForm('admin/config/development/performance', [], t('Clear all caches'));
+ $this->drupalPostForm('admin/config/development/performance', [], 'Clear all caches');
// Clearing all caches should not affect the state of the menu link.
$this->drupalGet('test-page');
diff --git a/core/modules/menu_ui/tests/src/Functional/MenuUiContentModerationTest.php b/core/modules/menu_ui/tests/src/Functional/MenuUiContentModerationTest.php
index d9d8d597ac0928bce59f787ef59059f2a7f3b928..190679e3e221e7c12cb15aae265a1bd01341468e 100644
--- a/core/modules/menu_ui/tests/src/Functional/MenuUiContentModerationTest.php
+++ b/core/modules/menu_ui/tests/src/Functional/MenuUiContentModerationTest.php
@@ -72,12 +72,12 @@ public function testMenuUiWithPendingRevisions() {
$node = $this->drupalCreateNode();
// Publish the node with no changes.
- $this->drupalPostForm('node/' . $node->id() . '/edit', [], t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', [], 'Save');
$this->assertSession()->responseContains(t('Page %label has been updated.', ['%label' => $node->toLink($node->label())->toString()]));
// Create a pending revision with no changes.
$edit = ['moderation_state[0][state]' => 'draft'];
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
$this->assertSession()->responseContains(t('Page %label has been updated.', ['%label' => $node->toLink($node->label())->toString()]));
// Add a menu link and save a new default (published) revision.
@@ -86,7 +86,7 @@ public function testMenuUiWithPendingRevisions() {
'menu[title]' => 'Test menu link',
'moderation_state[0][state]' => 'published',
];
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
$this->assertSession()->linkExists('Test menu link');
@@ -96,7 +96,7 @@ public function testMenuUiWithPendingRevisions() {
'menu[weight]' => 1,
'moderation_state[0][state]' => 'draft',
];
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
// Check that the menu settings were not applied.
$this->assertSession()->pageTextContains('You can only change the menu link weight for the published version of this content.');
@@ -107,7 +107,7 @@ public function testMenuUiWithPendingRevisions() {
'menu[menu_parent]' => 'main:test_page_test.front_page',
'moderation_state[0][state]' => 'draft',
];
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
// Check that the menu settings were not applied.
$this->assertSession()->pageTextContains('You can only change the parent menu link for the published version of this content.');
@@ -117,7 +117,7 @@ public function testMenuUiWithPendingRevisions() {
'menu[enabled]' => 0,
'moderation_state[0][state]' => 'draft',
];
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
// Check that the menu settings were not applied.
$this->assertSession()->pageTextContains('You can only remove the menu link in the published version of this content.');
@@ -130,7 +130,7 @@ public function testMenuUiWithPendingRevisions() {
'menu[description]' => 'Test menu link description',
'moderation_state[0][state]' => 'draft',
];
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
$this->assertSession()->responseContains(t('Page %label has been updated.', ['%label' => $node->toLink($node->label())->toString()]));
// Ensure the content was not immediately published.
@@ -140,20 +140,20 @@ public function testMenuUiWithPendingRevisions() {
$edit = [
'moderation_state[0][state]' => 'published',
];
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
$this->assertSession()->linkExists('Test menu link draft');
// Try to save a new non-default (draft) revision without any changes and
// check that the error message is not shown.
$edit = ['moderation_state[0][state]' => 'draft'];
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
// Create a node.
$node = $this->drupalCreateNode();
// Publish the node with no changes.
$edit = ['moderation_state[0][state]' => 'published'];
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
$this->assertSession()->responseContains(t('Page %label has been updated.', ['%label' => $node->toLink($node->label())->toString()]));
// Add a menu link and save and create a new non-default (draft) revision
@@ -163,7 +163,7 @@ public function testMenuUiWithPendingRevisions() {
'menu[title]' => 'Second test menu link',
'moderation_state[0][state]' => 'draft',
];
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
$this->assertSession()->responseContains(t('Page %label has been updated.', ['%label' => $node->toLink($node->label())->toString()]));
$this->assertSession()->linkNotExists('Second test menu link');
@@ -171,7 +171,7 @@ public function testMenuUiWithPendingRevisions() {
$edit = [
'moderation_state[0][state]' => 'published',
];
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
$this->assertSession()->responseContains(t('Page %label has been updated.', ['%label' => $node->toLink($node->label())->toString()]));
$this->assertSession()->linkExists('Second test menu link');
}
diff --git a/core/modules/menu_ui/tests/src/Functional/MenuUiLanguageTest.php b/core/modules/menu_ui/tests/src/Functional/MenuUiLanguageTest.php
index 36266be27c4be9f38c2256b2d54e08167033d6f1..deec3baacdd7b228c48f0f27f92055b857d5f9f9 100644
--- a/core/modules/menu_ui/tests/src/Functional/MenuUiLanguageTest.php
+++ b/core/modules/menu_ui/tests/src/Functional/MenuUiLanguageTest.php
@@ -66,7 +66,7 @@ public function testMenuLanguage() {
'label' => $label,
'langcode' => 'aa',
];
- $this->drupalPostForm('admin/structure/menu/add', $edit, t('Save'));
+ $this->drupalPostForm('admin/structure/menu/add', $edit, 'Save');
ContentLanguageSettings::loadByEntityTypeBundle('menu_link_content', 'menu_link_content')
->setDefaultLangcode('bb')
->setLanguageAlterable(TRUE)
@@ -84,7 +84,7 @@ public function testMenuLanguage() {
'title[0][value]' => $link_title,
'link[0][uri]' => $link_path,
];
- $this->drupalPostForm("admin/structure/menu/manage/$menu_name/add", $edit, t('Save'));
+ $this->drupalPostForm("admin/structure/menu/manage/$menu_name/add", $edit, 'Save');
// Check the link was added with the correct menu link default language.
$menu_links = \Drupal::entityTypeManager()->getStorage('menu_link_content')->loadByProperties(['title' => $link_title]);
$menu_link = reset($menu_links);
@@ -106,7 +106,7 @@ public function testMenuLanguage() {
'title[0][value]' => $link_title,
'link[0][uri]' => $link_path,
];
- $this->drupalPostForm("admin/structure/menu/manage/$menu_name/add", $edit, t('Save'));
+ $this->drupalPostForm("admin/structure/menu/manage/$menu_name/add", $edit, 'Save');
// Check the link was added with the correct new menu link default language.
$menu_links = \Drupal::entityTypeManager()->getStorage('menu_link_content')->loadByProperties(['title' => $link_title]);
$menu_link = reset($menu_links);
@@ -120,7 +120,7 @@ public function testMenuLanguage() {
$edit = [
'langcode[0][value]' => 'bb',
];
- $this->drupalPostForm('admin/structure/menu/item/' . $menu_link->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('admin/structure/menu/item/' . $menu_link->id() . '/edit', $edit, 'Save');
$this->assertMenuLink([
'menu_name' => $menu_name,
'route_name' => '',
diff --git a/core/modules/menu_ui/tests/src/Functional/MenuUiNodeTest.php b/core/modules/menu_ui/tests/src/Functional/MenuUiNodeTest.php
index 5420336b2aed53f68666ef1f91d0c4e270a47fc7..5aa6ddf4c85e174350d7e7f3eebb645e164ebc75 100644
--- a/core/modules/menu_ui/tests/src/Functional/MenuUiNodeTest.php
+++ b/core/modules/menu_ui/tests/src/Functional/MenuUiNodeTest.php
@@ -89,7 +89,7 @@ public function testMenuNodeFormWidget() {
$edit = [
'menu_options[main]' => FALSE,
];
- $this->drupalPostForm('admin/structure/types/manage/page', $edit, t('Save content type'));
+ $this->drupalPostForm('admin/structure/types/manage/page', $edit, 'Save content type');
// Verify that no menu settings are displayed and nodes can be created.
$this->drupalGet('node/add/page');
@@ -100,7 +100,7 @@ public function testMenuNodeFormWidget() {
'title[0][value]' => $node_title,
'body[0][value]' => $this->randomString(),
];
- $this->drupalPostForm(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, 'Save');
$node = $this->drupalGetNodeByTitle($node_title);
$this->assertEqual($node->getTitle(), $edit['title[0][value]']);
@@ -110,7 +110,7 @@ public function testMenuNodeFormWidget() {
'menu_options[tools]' => 1,
'menu_parent' => 'main:',
];
- $this->drupalPostForm('admin/structure/types/manage/page', $edit, t('Save content type'));
+ $this->drupalPostForm('admin/structure/types/manage/page', $edit, 'Save content type');
$this->assertText('The selected menu link is not under one of the selected menus.');
$this->assertNoRaw(t('The content type %name has been updated.', ['%name' => 'Basic page']));
@@ -120,7 +120,7 @@ public function testMenuNodeFormWidget() {
'menu_options[tools]' => 1,
'menu_parent' => 'main:',
];
- $this->drupalPostForm('admin/structure/types/manage/page', $edit, t('Save content type'));
+ $this->drupalPostForm('admin/structure/types/manage/page', $edit, 'Save content type');
$this->assertRaw(t('The content type %name has been updated.', ['%name' => 'Basic page']));
// Test that we can preview a node that will create a menu item.
@@ -129,7 +129,7 @@ public function testMenuNodeFormWidget() {
'menu[enabled]' => 1,
'menu[title]' => 'Test preview',
];
- $this->drupalPostForm('node/add/page', $edit, t('Preview'));
+ $this->drupalPostForm('node/add/page', $edit, 'Preview');
// Create a node.
$node_title = $this->randomMachineName();
@@ -137,7 +137,7 @@ public function testMenuNodeFormWidget() {
'title[0][value]' => $node_title,
'body[0][value]' => $this->randomString(),
];
- $this->drupalPostForm('node/add/page', $edit, t('Save'));
+ $this->drupalPostForm('node/add/page', $edit, 'Save');
$node = $this->drupalGetNodeByTitle($node_title);
// Assert that there is no link for the node.
$this->drupalGet('test-page');
@@ -147,7 +147,7 @@ public function testMenuNodeFormWidget() {
$edit = [
'menu[enabled]' => 1,
];
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
// Assert that there is no link for the node.
$this->drupalGet('test-page');
$this->assertSession()->linkNotExists($node_title);
@@ -186,7 +186,7 @@ public function testMenuNodeFormWidget() {
'menu[title]' => $node_title,
'menu[weight]' => 17,
];
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
// Assert that the link exists.
$this->drupalGet('test-page');
$this->assertSession()->linkExists($node_title);
@@ -206,7 +206,7 @@ public function testMenuNodeFormWidget() {
$link = MenuLinkContent::load($link_id);
$link->set('enabled', FALSE);
$link->save();
- $this->drupalPostForm($node->toUrl('edit-form'), $edit, t('Save'));
+ $this->drupalPostForm($node->toUrl('edit-form'), $edit, 'Save');
$link = MenuLinkContent::load($link_id);
$this->assertFalse($link->isEnabled(), 'Saving a node with a disabled menu link keeps the menu link disabled.');
@@ -214,7 +214,7 @@ public function testMenuNodeFormWidget() {
$edit = [
'menu[enabled]' => FALSE,
];
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
// Assert that there is no link for the node.
$this->drupalGet('test-page');
$this->assertSession()->linkNotExists($node_title);
@@ -232,7 +232,7 @@ public function testMenuNodeFormWidget() {
$this->drupalGet('node/' . $node->id() . '/edit');
$this->assertText('Provide a menu link', 'Link in not allowed menu not shown in node edit form');
// Assert that the link is still in the Administration menu after save.
- $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
+ $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, 'Save');
$link = MenuLinkContent::load($item->id());
$this->assertInstanceOf(MenuLinkContent::class, $link);
@@ -294,7 +294,7 @@ public function testMultilingualMenuNodeFormWidget() {
'settings[node][page][fields][title]' => TRUE,
'settings[menu_link_content][menu_link_content][translatable]' => TRUE,
];
- $this->drupalPostForm('admin/config/regional/content-language', $edit, t('Save configuration'));
+ $this->drupalPostForm('admin/config/regional/content-language', $edit, 'Save configuration');
// Log out and back in as normal user.
$this->drupalLogout();
@@ -325,7 +325,7 @@ public function testMultilingualMenuNodeFormWidget() {
];
$options = ['language' => $languages[$langcodes[0]]];
$url = $node->toUrl('edit-form', $options);
- $this->drupalPostForm($url, $edit, t('Save') . ' ' . t('(this translation)'));
+ $this->drupalPostForm($url, $edit, 'Save (this translation)');
// Edit the node in a different language and translate the menu link.
$edit = [
@@ -335,7 +335,7 @@ public function testMultilingualMenuNodeFormWidget() {
];
$options = ['language' => $languages[$langcodes[1]]];
$url = $node->toUrl('edit-form', $options);
- $this->drupalPostForm($url, $edit, t('Save') . ' ' . t('(this translation)'));
+ $this->drupalPostForm($url, $edit, 'Save (this translation)');
// Assert that the original link exists in the frontend.
$this->drupalGet('node/' . $node->id(), ['language' => $languages[$langcodes[0]]]);
@@ -350,7 +350,7 @@ public function testMultilingualMenuNodeFormWidget() {
$url = $node->toUrl('edit-form', $options);
$this->drupalGet($url);
$this->assertSession()->fieldValueEquals('edit-menu-title', $node_title);
- $this->drupalPostForm(NULL, [], t('Save') . ' ' . t('(this translation)'));
+ $this->drupalPostForm(NULL, [], 'Save (this translation)');
// Revisit the edit page of the translation and check the loaded menu item title.
$options = ['language' => $languages[$langcodes[1]]];
diff --git a/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php b/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
index b817c8239298cd0127de371829f898a70c51668a..65c5cc4b079e224eca29615563c86c8b7110c51d 100644
--- a/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
+++ b/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
@@ -158,7 +158,7 @@ public function testMenu() {
$edit = [];
$edit['weight'] = 10;
$id = $instance->getPluginId();
- $this->drupalPostForm("admin/structure/menu/link/$id/edit", $edit, t('Save'));
+ $this->drupalPostForm("admin/structure/menu/link/$id/edit", $edit, 'Save');
$this->assertSession()->statusCodeEquals(200);
$this->assertText('The menu link has been saved.');
$menu_link_manager->resetDefinitions();
@@ -211,7 +211,7 @@ public function addCustomMenu() {
'description' => '',
'label' => $label,
];
- $this->drupalPostForm('admin/structure/menu/add', $edit, t('Save'));
+ $this->drupalPostForm('admin/structure/menu/add', $edit, 'Save');
// Verify that using a menu_name that is too long results in a validation
// message.
@@ -224,7 +224,7 @@ public function addCustomMenu() {
// Change the menu_name so it no longer exceeds the maximum length.
$menu_name = strtolower($this->randomMachineName(MenuStorage::MAX_ID_LENGTH));
$edit['id'] = $menu_name;
- $this->drupalPostForm('admin/structure/menu/add', $edit, t('Save'));
+ $this->drupalPostForm('admin/structure/menu/add', $edit, 'Save');
// Verify that no validation error is given for menu_name length.
$this->assertNoRaw(t('@name cannot be longer than %max characters but is currently %length characters long.', [
@@ -259,7 +259,7 @@ public function deleteCustomMenu() {
$label = $this->menu->label();
// Delete custom menu.
- $this->drupalPostForm("admin/structure/menu/manage/$menu_name/delete", [], t('Delete'));
+ $this->drupalPostForm("admin/structure/menu/manage/$menu_name/delete", [], 'Delete');
$this->assertSession()->statusCodeEquals(200);
$this->assertRaw(t('The menu %title has been deleted.', ['%title' => $label]));
$this->assertNull(Menu::load($menu_name), 'Custom menu was deleted');
@@ -288,18 +288,18 @@ public function doMenuTests() {
$this->clickLink(t('Add link'));
$link_title = $this->randomString();
- $this->drupalPostForm(NULL, ['link[0][uri]' => '/', 'title[0][value]' => $link_title], t('Save'));
+ $this->drupalPostForm(NULL, ['link[0][uri]' => '/', 'title[0][value]' => $link_title], 'Save');
$this->assertSession()->addressEquals(Url::fromRoute('entity.menu.edit_form', ['menu' => $menu_name]));
// Test the 'Edit' operation.
$this->clickLink(t('Edit'));
$this->assertSession()->fieldValueEquals('title[0][value]', $link_title);
$link_title = $this->randomString();
- $this->drupalPostForm(NULL, ['title[0][value]' => $link_title], t('Save'));
+ $this->drupalPostForm(NULL, ['title[0][value]' => $link_title], 'Save');
$this->assertSession()->addressEquals(Url::fromRoute('entity.menu.edit_form', ['menu' => $menu_name]));
// Test the 'Delete' operation.
$this->clickLink(t('Delete'));
$this->assertRaw(t('Are you sure you want to delete the custom menu link %item?', ['%item' => $link_title]));
- $this->drupalPostForm(NULL, [], t('Delete'));
+ $this->drupalPostForm(NULL, [], 'Delete');
$this->assertSession()->addressEquals(Url::fromRoute('entity.menu.edit_form', ['menu' => $menu_name]));
// Add nodes to use as links for menu links.
@@ -457,7 +457,7 @@ public function doMenuTests() {
$this->disableMenuLink($item1);
$edit = [];
$edit['links[menu_plugin_id:' . $item1->getPluginId() . '][enabled]'] = TRUE;
- $this->drupalPostForm('admin/structure/menu/manage/' . $item1->getMenuName(), $edit, t('Save'));
+ $this->drupalPostForm('admin/structure/menu/manage/' . $item1->getMenuName(), $edit, 'Save');
// Mark item2, item4 and item5 as expanded.
// This is done in order to show them on the frontpage.
@@ -525,7 +525,7 @@ public function testMenuQueryAndFragment() {
// Now change the path to something without query and fragment.
$path = '/test-page';
- $this->drupalPostForm('admin/structure/menu/item/' . $item->id() . '/edit', ['link[0][uri]' => $path], t('Save'));
+ $this->drupalPostForm('admin/structure/menu/item/' . $item->id() . '/edit', ['link[0][uri]' => $path], 'Save');
$this->drupalGet('admin/structure/menu/item/' . $item->id() . '/edit');
$this->assertSession()->fieldValueEquals('link[0][uri]', $path);
@@ -536,7 +536,7 @@ public function testMenuQueryAndFragment() {
$this->drupalGet('admin/structure/menu/item/' . $item->id() . '/edit');
$this->assertSession()->fieldValueEquals('link[0][uri]', $path);
- $this->drupalPostForm('admin/structure/menu/item/' . $item->id() . '/edit', [], t('Save'));
+ $this->drupalPostForm('admin/structure/menu/item/' . $item->id() . '/edit', [], 'Save');
$this->drupalGet('admin/structure/menu/item/' . $item->id() . '/edit');
$this->assertSession()->fieldValueEquals('link[0][uri]', $path);
@@ -550,7 +550,7 @@ public function testSystemMenuRename() {
$edit = [
'label' => $this->randomMachineName(16),
];
- $this->drupalPostForm('admin/structure/menu/manage/main', $edit, t('Save'));
+ $this->drupalPostForm('admin/structure/menu/manage/main', $edit, 'Save');
// Make sure menu shows up with new name in block addition.
$default_theme = $this->config('system.theme')->get('default');
@@ -626,7 +626,7 @@ public function addMenuLink($parent = '', $path = '/', $menu_name = 'tools', $ex
];
// Add menu link.
- $this->drupalPostForm(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, 'Save');
$this->assertSession()->statusCodeEquals(200);
$this->assertText('The menu link has been saved.');
@@ -648,7 +648,7 @@ public function addInvalidMenuLink() {
'link[0][uri]' => $link_path,
'title[0][value]' => 'title',
];
- $this->drupalPostForm("admin/structure/menu/manage/{$this->menu->id()}/add", $edit, t('Save'));
+ $this->drupalPostForm("admin/structure/menu/manage/{$this->menu->id()}/add", $edit, 'Save');
$this->assertRaw(t("The path '@link_path' is inaccessible.", ['@link_path' => $link_path]));
}
}
@@ -677,7 +677,7 @@ public function checkInvalidParentMenuLinks() {
'expanded[value]' => FALSE,
'weight[0][value]' => '0',
];
- $this->drupalPostForm("admin/structure/menu/manage/{$this->menu->id()}/add", $edit, t('Save'));
+ $this->drupalPostForm("admin/structure/menu/manage/{$this->menu->id()}/add", $edit, 'Save');
$menu_links = \Drupal::entityTypeManager()->getStorage('menu_link_content')->loadByProperties(['title' => $title]);
$last_link = reset($menu_links);
$created_links[] = 'tools:' . $last_link->getPluginId();
@@ -750,7 +750,7 @@ public function moveMenuLink(MenuLinkContent $item, $parent, $menu_name) {
$edit = [
'menu_parent' => $menu_name . ':' . $parent,
];
- $this->drupalPostForm("admin/structure/menu/item/$mlid/edit", $edit, t('Save'));
+ $this->drupalPostForm("admin/structure/menu/item/$mlid/edit", $edit, 'Save');
$this->assertSession()->statusCodeEquals(200);
}
@@ -769,7 +769,7 @@ public function modifyMenuLink(MenuLinkContent $item) {
// Edit menu link.
$edit = [];
$edit['title[0][value]'] = $title;
- $this->drupalPostForm("admin/structure/menu/item/$mlid/edit", $edit, t('Save'));
+ $this->drupalPostForm("admin/structure/menu/item/$mlid/edit", $edit, 'Save');
$this->assertSession()->statusCodeEquals(200);
$this->assertText('The menu link has been saved.');
// Verify menu link.
@@ -787,7 +787,7 @@ public function modifyMenuLink(MenuLinkContent $item) {
*/
public function resetMenuLink(MenuLinkInterface $menu_link, $old_weight) {
// Reset menu link.
- $this->drupalPostForm("admin/structure/menu/link/{$menu_link->getPluginId()}/reset", [], t('Reset'));
+ $this->drupalPostForm("admin/structure/menu/link/{$menu_link->getPluginId()}/reset", [], 'Reset');
$this->assertSession()->statusCodeEquals(200);
$this->assertRaw(t('The menu link was reset to its default settings.'));
@@ -807,7 +807,7 @@ public function deleteMenuLink(MenuLinkContent $item) {
$title = $item->getTitle();
// Delete menu link.
- $this->drupalPostForm("admin/structure/menu/item/$mlid/delete", [], t('Delete'));
+ $this->drupalPostForm("admin/structure/menu/item/$mlid/delete", [], 'Delete');
$this->assertSession()->statusCodeEquals(200);
$this->assertRaw(t('The menu link %title has been deleted.', ['%title' => $title]));
@@ -844,7 +844,7 @@ public function toggleMenuLink(MenuLinkContent $item) {
public function disableMenuLink(MenuLinkContent $item) {
$mlid = $item->id();
$edit['enabled[value]'] = FALSE;
- $this->drupalPostForm("admin/structure/menu/item/$mlid/edit", $edit, t('Save'));
+ $this->drupalPostForm("admin/structure/menu/item/$mlid/edit", $edit, 'Save');
// Unlike most other modules, there is no confirmation message displayed.
// Verify in the database.
@@ -860,7 +860,7 @@ public function disableMenuLink(MenuLinkContent $item) {
public function enableMenuLink(MenuLinkContent $item) {
$mlid = $item->id();
$edit['enabled[value]'] = TRUE;
- $this->drupalPostForm("admin/structure/menu/item/$mlid/edit", $edit, t('Save'));
+ $this->drupalPostForm("admin/structure/menu/item/$mlid/edit", $edit, 'Save');
// Verify in the database.
$this->assertMenuLink(['enabled' => 1], $item->getPluginId());
@@ -909,7 +909,7 @@ public function testExpandAllItems() {
'settings[depth]' => 2,
'settings[level]' => 1,
'settings[expand_all_items]' => 1,
- ], t('Save block'));
+ ], 'Save block');
// Ensure the setting is persisted.
$this->drupalGet('admin/structure/block/manage/' . $block_id);
@@ -994,7 +994,7 @@ protected function doTestMenuBlock() {
$this->drupalPostForm(NULL, [
'settings[depth]' => 3,
'settings[level]' => 2,
- ], t('Save block'));
+ ], 'Save block');
$block = Block::load($block_id);
$settings = $block->getPlugin()->getConfiguration();
$this->assertEqual($settings['depth'], 3);
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php
index b792a14e54b81af53cf4737c5e50248488949e59..7867ff12d6882d4cabcc0d5b6c94b0eb324246cc 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php
@@ -36,24 +36,24 @@ public function testMigrateUpgradeExecute() {
$session = $this->assertSession();
$session->responseContains("Upgrade a site by importing its files and the data from its database into a clean and empty new install of Drupal $this->destinationSiteVersion.");
- $this->drupalPostForm(NULL, [], t('Continue'));
+ $this->drupalPostForm(NULL, [], 'Continue');
$session->pageTextContains('Provide credentials for the database of the Drupal site you want to upgrade.');
$session->fieldExists('mysql[host]');
// Get valid credentials.
$edits = $this->translatePostValues($this->getCredentials());
- $this->drupalPostForm(NULL, $edits, t('Review upgrade'));
+ $this->drupalPostForm(NULL, $edits, 'Review upgrade');
// Restart the upgrade process.
$this->drupalGet('/upgrade');
$session->responseContains("Upgrade a site by importing its files and the data from its database into a clean and empty new install of Drupal $this->destinationSiteVersion.");
- $this->drupalPostForm(NULL, [], t('Continue'));
+ $this->drupalPostForm(NULL, [], 'Continue');
$session->pageTextContains('Provide credentials for the database of the Drupal site you want to upgrade.');
$session->fieldExists('mysql[host]');
- $this->drupalPostForm(NULL, $edits, t('Review upgrade'));
+ $this->drupalPostForm(NULL, $edits, 'Review upgrade');
$entity_types = [
'block_content',
'menu_link_content',
@@ -63,7 +63,7 @@ public function testMigrateUpgradeExecute() {
];
$this->assertIdConflictForm($entity_types);
- $this->drupalPostForm(NULL, [], t('I acknowledge I may lose data. Continue anyway.'));
+ $this->drupalPostForm(NULL, [], 'I acknowledge I may lose data. Continue anyway.');
$session->statusCodeEquals(200);
// Ensure there are no errors about missing modules from the test module.
@@ -75,7 +75,7 @@ public function testMigrateUpgradeExecute() {
// Test the review form.
$this->assertReviewForm();
- $this->drupalPostForm(NULL, [], t('Perform upgrade'));
+ $this->drupalPostForm(NULL, [], 'Perform upgrade');
$this->assertUpgrade($this->getEntityCounts());
\Drupal::service('module_installer')->install(['forum']);
@@ -86,19 +86,19 @@ public function testMigrateUpgradeExecute() {
$this->drupalGet('/upgrade');
$session->pageTextContains("An upgrade has already been performed on this site. To perform a new migration, create a clean and empty new install of Drupal $this->destinationSiteVersion. Rollbacks are not yet supported through the user interface.");
- $this->drupalPostForm(NULL, [], t('Import new configuration and content from old site'));
- $this->drupalPostForm(NULL, $edits, t('Review upgrade'));
+ $this->drupalPostForm(NULL, [], 'Import new configuration and content from old site');
+ $this->drupalPostForm(NULL, $edits, 'Review upgrade');
$session->pageTextContains('WARNING: Content may be overwritten on your new site.');
$session->pageTextContains('There is conflicting content of these types:');
$session->pageTextContains('files');
$session->pageTextContains('There is translated content of these types:');
$session->pageTextContainsOnce('content items');
- $this->drupalPostForm(NULL, [], t('I acknowledge I may lose data. Continue anyway.'));
+ $this->drupalPostForm(NULL, [], 'I acknowledge I may lose data. Continue anyway.');
$session->statusCodeEquals(200);
// Run the incremental migration and check the results.
- $this->drupalPostForm(NULL, [], t('Perform upgrade'));
+ $this->drupalPostForm(NULL, [], 'Perform upgrade');
$this->assertUpgrade($this->getEntityCountsIncremental());
}
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeFormStepsTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeFormStepsTest.php
index 0e45d19c8f0db484d4844b075347c191ffe966c4..a35883e24943dda9acd2ce4caa3ecb1061d2a67f 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeFormStepsTest.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeFormStepsTest.php
@@ -116,7 +116,7 @@ public function testMigrateUpgradeReviewPage() {
$store->set('step', 'overview');
$this->drupalGet('/upgrade');
$session->pageTextContains("An upgrade has already been performed on this site. To perform a new migration, create a clean and empty new install of Drupal $destination_site_version. Rollbacks are not yet supported through the user interface.");
- $this->drupalPostForm(NULL, [], t('Import new configuration and content from old site'));
+ $this->drupalPostForm(NULL, [], 'Import new configuration and content from old site');
$session->pageTextContains('Provide credentials for the database of the Drupal site you want to upgrade.');
}
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php b/core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php
index 000109240ddf04077435ea29b413bf627d3303e7..cbe0a62aa65e408cd8716d75b8dfd8a4ea7b2852 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php
@@ -44,13 +44,13 @@ public function testMigrateUpgradeReviewPage() {
$this->prepare();
// Start the upgrade process.
$this->drupalGet('/upgrade');
- $this->drupalPostForm(NULL, [], t('Continue'));
+ $this->drupalPostForm(NULL, [], 'Continue');
// Get valid credentials.
$edits = $this->translatePostValues($this->getCredentials());
- $this->drupalPostForm(NULL, $edits, t('Review upgrade'));
- $this->drupalPostForm(NULL, [], t('I acknowledge I may lose data. Continue anyway.'));
+ $this->drupalPostForm(NULL, $edits, 'Review upgrade');
+ $this->drupalPostForm(NULL, [], 'I acknowledge I may lose data. Continue anyway.');
// Ensure there are no errors about missing modules from the test module.
$session = $this->assertSession();
@@ -75,9 +75,9 @@ public function testMigrateUpgradeReviewPage() {
// Start the upgrade process.
$this->drupalGet('/upgrade');
- $this->drupalPostForm(NULL, [], t('Continue'));
- $this->drupalPostForm(NULL, $edits, t('Review upgrade'));
- $this->drupalPostForm(NULL, [], t('I acknowledge I may lose data. Continue anyway.'));
+ $this->drupalPostForm(NULL, [], 'Continue');
+ $this->drupalPostForm(NULL, $edits, 'Review upgrade');
+ $this->drupalPostForm(NULL, [], 'I acknowledge I may lose data. Continue anyway.');
// Test the upgrade paths. First remove the module from the available paths
// list.
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/NoMultilingualReviewPageTestBase.php b/core/modules/migrate_drupal_ui/tests/src/Functional/NoMultilingualReviewPageTestBase.php
index 9f26c1d58b0321cdaef4ac5d926897e2dd076872..1eb35233455f0afe178b37bb59e2e9a7d609e7dc 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/NoMultilingualReviewPageTestBase.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/NoMultilingualReviewPageTestBase.php
@@ -16,12 +16,12 @@ public function testMigrateUpgradeReviewPage() {
$this->prepare();
// Start the upgrade process.
$this->drupalGet('/upgrade');
- $this->drupalPostForm(NULL, [], t('Continue'));
+ $this->drupalPostForm(NULL, [], 'Continue');
// Get valid credentials.
$edits = $this->translatePostValues($this->getCredentials());
- $this->drupalPostForm(NULL, $edits, t('Review upgrade'));
+ $this->drupalPostForm(NULL, $edits, 'Review upgrade');
$session = $this->assertSession();
$session->pageTextContains('WARNING: Content may be overwritten on your new site.');
@@ -30,7 +30,7 @@ public function testMigrateUpgradeReviewPage() {
$session->pageTextContains('There is translated content of these types:');
$session->pageTextContainsOnce('content items');
- $this->drupalPostForm(NULL, [], t('I acknowledge I may lose data. Continue anyway.'));
+ $this->drupalPostForm(NULL, [], 'I acknowledge I may lose data. Continue anyway.');
$session->statusCodeEquals(200);
// Ensure there are no errors about missing modules from the test module.
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/SourceProviderTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/SourceProviderTest.php
index ac6b491eb82ccc16455cf8e01166893082f1eae2..8fd833d871135196d22a7cdc09b5ff4b2ceadaae 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/SourceProviderTest.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/SourceProviderTest.php
@@ -56,10 +56,10 @@ public function testSourceProvider($path_to_database) {
$this->drupalGet('/upgrade');
[$new_site_version] = explode('.', \Drupal::VERSION, 2);
$session->responseContains("Upgrade a site by importing its files and the data from its database into a clean and empty new install of Drupal $new_site_version.");
- $this->drupalPostForm(NULL, [], t('Continue'));
+ $this->drupalPostForm(NULL, [], 'Continue');
$session->pageTextContains('Provide credentials for the database of the Drupal site you want to upgrade.');
$session->fieldExists('mysql[host]');
- $this->drupalPostForm(NULL, $edits, t('Review upgrade'));
+ $this->drupalPostForm(NULL, $edits, 'Review upgrade');
// Ensure we get errors about missing modules.
$session->pageTextContains(t('Resolve all issues below to continue the upgrade.'));
@@ -72,10 +72,10 @@ public function testSourceProvider($path_to_database) {
// Restart the upgrade process and test there is no source_module error.
$this->drupalGet('/upgrade');
$session->responseContains("Upgrade a site by importing its files and the data from its database into a clean and empty new install of Drupal $new_site_version.");
- $this->drupalPostForm(NULL, [], t('Continue'));
+ $this->drupalPostForm(NULL, [], 'Continue');
$session->pageTextContains('Provide credentials for the database of the Drupal site you want to upgrade.');
$session->fieldExists('mysql[host]');
- $this->drupalPostForm(NULL, $edits, t('Review upgrade'));
+ $this->drupalPostForm(NULL, $edits, 'Review upgrade');
// Ensure there are no errors about missing modules from the test module.
$session->pageTextNotContains(t('Source module not found for migration_provider_no_annotation.'));
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/IdConflictTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/IdConflictTest.php
index b38ad9c71ec128f5e216c8de69e18ac2f342519a..dc092ec9040795621caf0e1dd453b382dc5730b8 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/IdConflictTest.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/IdConflictTest.php
@@ -75,7 +75,7 @@ public function testMigrateUpgradeExecute() {
$session = $this->assertSession();
$session->responseContains("Upgrade a site by importing its files and the data from its database into a clean and empty new install of Drupal $this->destinationSiteVersion.");
- $this->drupalPostForm(NULL, [], t('Continue'));
+ $this->drupalPostForm(NULL, [], 'Continue');
$session->pageTextContains('Provide credentials for the database of the Drupal site you want to upgrade.');
$session->fieldExists('mysql[host]');
@@ -86,11 +86,11 @@ public function testMigrateUpgradeExecute() {
$this->drupalGet('/upgrade');
$session->responseContains("Upgrade a site by importing its files and the data from its database into a clean and empty new install of Drupal $this->destinationSiteVersion.");
- $this->drupalPostForm(NULL, [], t('Continue'));
+ $this->drupalPostForm(NULL, [], 'Continue');
$session->pageTextContains('Provide credentials for the database of the Drupal site you want to upgrade.');
$session->fieldExists('mysql[host]');
- $this->drupalPostForm(NULL, $edits, t('Review upgrade'));
+ $this->drupalPostForm(NULL, $edits, 'Review upgrade');
$entity_types = [
'block_content',
'menu_link_content',
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/NodeClassicTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/NodeClassicTest.php
index 77298ef8e7ee14c816694e4670bbb31ec5ea091d..f750703cb394da5e5a70eea9a7aa993a660614cd 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/NodeClassicTest.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/NodeClassicTest.php
@@ -85,7 +85,7 @@ public function testMigrateUpgradeExecute() {
$session = $this->assertSession();
$session->responseContains("Upgrade a site by importing its files and the data from its database into a clean and empty new install of Drupal $this->destinationSiteVersion.");
- $this->drupalPostForm(NULL, [], t('Continue'));
+ $this->drupalPostForm(NULL, [], 'Continue');
$session->pageTextContains('Provide credentials for the database of the Drupal site you want to upgrade.');
$session->fieldExists('mysql[host]');
@@ -96,12 +96,12 @@ public function testMigrateUpgradeExecute() {
$this->drupalGet('/upgrade');
$session->responseContains("Upgrade a site by importing its files and the data from its database into a clean and empty new install of Drupal $this->destinationSiteVersion.");
- $this->drupalPostForm(NULL, [], t('Continue'));
+ $this->drupalPostForm(NULL, [], 'Continue');
$session->pageTextContains('Provide credentials for the database of the Drupal site you want to upgrade.');
$session->fieldExists('mysql[host]');
// When the Credential form is submitted the migrate map tables are created.
- $this->drupalPostForm(NULL, $edits, t('Review upgrade'));
+ $this->drupalPostForm(NULL, $edits, 'Review upgrade');
// Confirm there are only classic node migration map tables. This shows
// that only the classic migration will run.
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/IdConflictTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/IdConflictTest.php
index 43a3003e9384a751820ae47ea36dc3fb8659e21b..9fc5b3e347e577c91e355511416b81ae5e28f12d 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/IdConflictTest.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/IdConflictTest.php
@@ -77,7 +77,7 @@ public function testMigrateUpgradeExecute() {
$session = $this->assertSession();
$session->responseContains("Upgrade a site by importing its files and the data from its database into a clean and empty new install of Drupal $this->destinationSiteVersion.");
- $this->drupalPostForm(NULL, [], t('Continue'));
+ $this->drupalPostForm(NULL, [], 'Continue');
$session->pageTextContains('Provide credentials for the database of the Drupal site you want to upgrade.');
$session->fieldExists('mysql[host]');
@@ -88,11 +88,11 @@ public function testMigrateUpgradeExecute() {
$this->drupalGet('/upgrade');
$session->responseContains("Upgrade a site by importing its files and the data from its database into a clean and empty new install of Drupal $this->destinationSiteVersion.");
- $this->drupalPostForm(NULL, [], t('Continue'));
+ $this->drupalPostForm(NULL, [], 'Continue');
$session->pageTextContains('Provide credentials for the database of the Drupal site you want to upgrade.');
$session->fieldExists('mysql[host]');
- $this->drupalPostForm(NULL, $edits, t('Review upgrade'));
+ $this->drupalPostForm(NULL, $edits, 'Review upgrade');
$entity_types = [
'block_content',
'menu_link_content',
diff --git a/core/modules/node/tests/src/Functional/MultiStepNodeFormBasicOptionsTest.php b/core/modules/node/tests/src/Functional/MultiStepNodeFormBasicOptionsTest.php
index 6b398206325f357d69ebfd2138449731eae021f9..f6484eaee38cda6174ab2f43cb5215a900e3e8bb 100644
--- a/core/modules/node/tests/src/Functional/MultiStepNodeFormBasicOptionsTest.php
+++ b/core/modules/node/tests/src/Functional/MultiStepNodeFormBasicOptionsTest.php
@@ -64,7 +64,7 @@ public function testMultiStepNodeFormBasicOptions() {
'sticky[value]' => 1,
"{$this->fieldName}[0][value]" => $this->randomString(32),
];
- $this->drupalPostForm('node/add/page', $edit, t('Add another item'));
+ $this->drupalPostForm('node/add/page', $edit, 'Add another item');
$this->assertSession()->checkboxNotChecked('edit-promote-value');
$this->assertSession()->checkboxChecked('edit-sticky-value');
}
diff --git a/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php b/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php
index ca9c1c814b8f93bd0668486e86ac220c5d45ea3d..84086f4a6d4c6497bedb5a36910d34bdf1c68097 100644
--- a/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php
+++ b/core/modules/node/tests/src/Functional/NodeAccessBaseTableTest.php
@@ -120,7 +120,7 @@ public function testNodeAccessBasic() {
$edit['field_tags[target_id]'] = 'public';
}
- $this->drupalPostForm('node/add/article', $edit, t('Save'));
+ $this->drupalPostForm('node/add/article', $edit, 'Save');
$node = $this->drupalGetNodeByTitle($edit['title[0][value]']);
$this->assertEqual($is_private, (int) $node->private->value, 'The private status of the node was properly set in the node_access_test table.');
if ($is_private) {
diff --git a/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php b/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php
index 069d812891fecbb067596bbc98b794765da656b9..649238f25eda24838e2f74e2dca0f398e984501d 100644
--- a/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php
+++ b/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php
@@ -109,7 +109,7 @@ public function testNodeAccessAdministerField() {
$this->drupalPostForm(
"admin/structure/types/manage/page/fields/node.page.{$this->fieldName}",
$edit,
- t('Save settings')
+ 'Save settings'
);
// Log in as the administrator.
diff --git a/core/modules/node/tests/src/Functional/NodeAccessMenuLinkTest.php b/core/modules/node/tests/src/Functional/NodeAccessMenuLinkTest.php
index f394d82de1c636f7676ec2c4a6ff7e5ce9366de7..6476e8c05af8ae99a2f7903f9929ff3d1ffbba3f 100644
--- a/core/modules/node/tests/src/Functional/NodeAccessMenuLinkTest.php
+++ b/core/modules/node/tests/src/Functional/NodeAccessMenuLinkTest.php
@@ -58,7 +58,7 @@ public function testNodeAccessMenuLink() {
'menu[enabled]' => 1,
'menu[title]' => $menu_link_title,
];
- $this->drupalPostForm('node/add/page', $edit, t('Save'));
+ $this->drupalPostForm('node/add/page', $edit, 'Save');
$this->assertSession()->linkExists($menu_link_title);
// Ensure anonymous users without "access content" permission do not see
diff --git a/core/modules/node/tests/src/Functional/NodeAccessRebuildNodeGrantsTest.php b/core/modules/node/tests/src/Functional/NodeAccessRebuildNodeGrantsTest.php
index d906c57851d7fad5b251ab9703fdef0d66759996..333834f2ab52f0c7a9113b4a46f954b7694330a2 100644
--- a/core/modules/node/tests/src/Functional/NodeAccessRebuildNodeGrantsTest.php
+++ b/core/modules/node/tests/src/Functional/NodeAccessRebuildNodeGrantsTest.php
@@ -80,7 +80,7 @@ public function testNodeAccessRebuildNodeGrants() {
// Rebuild permissions.
$this->drupalGet('admin/reports/status');
$this->clickLink(t('Rebuild permissions'));
- $this->drupalPostForm(NULL, [], t('Rebuild permissions'));
+ $this->drupalPostForm(NULL, [], 'Rebuild permissions');
$this->assertText('The content access permissions have been rebuilt.');
// Test if the rebuild by user that cannot bypass node access and does not
@@ -116,7 +116,7 @@ public function testNodeAccessRebuildNoAccessModules() {
// Rebuild permissions.
$this->drupalGet('admin/reports/status');
$this->clickLink(t('Rebuild permissions'));
- $this->drupalPostForm(NULL, [], t('Rebuild permissions'));
+ $this->drupalPostForm(NULL, [], 'Rebuild permissions');
$this->assertText('Content permissions have been rebuilt.');
$this->assertNull(\Drupal::state()->get('node.node_access_needs_rebuild'), 'Node access permissions have been rebuilt');
diff --git a/core/modules/node/tests/src/Functional/NodeActionsConfigurationTest.php b/core/modules/node/tests/src/Functional/NodeActionsConfigurationTest.php
index 8184fefd2ca0c95851c2f993097527534c5af0fc..2a20d395ebc549a65bb934c5b695a75297b80e48 100644
--- a/core/modules/node/tests/src/Functional/NodeActionsConfigurationTest.php
+++ b/core/modules/node/tests/src/Functional/NodeActionsConfigurationTest.php
@@ -37,7 +37,7 @@ public function testAssignOwnerNodeActionConfiguration() {
// Make a POST request to admin/config/system/actions.
$edit = [];
$edit['action'] = 'node_assign_owner_action';
- $this->drupalPostForm('admin/config/system/actions', $edit, t('Create'));
+ $this->drupalPostForm('admin/config/system/actions', $edit, 'Create');
$this->assertSession()->statusCodeEquals(200);
// Make a POST request to the individual action configuration page.
@@ -46,7 +46,7 @@ public function testAssignOwnerNodeActionConfiguration() {
$edit['label'] = $action_label;
$edit['id'] = strtolower($action_label);
$edit['owner_uid'] = $user->id();
- $this->drupalPostForm('admin/config/system/actions/add/node_assign_owner_action', $edit, t('Save'));
+ $this->drupalPostForm('admin/config/system/actions/add/node_assign_owner_action', $edit, 'Save');
$this->assertSession()->statusCodeEquals(200);
$action_id = $edit['id'];
@@ -61,7 +61,7 @@ public function testAssignOwnerNodeActionConfiguration() {
$new_action_label = $this->randomMachineName();
$edit['label'] = $new_action_label;
$edit['owner_uid'] = $user->id();
- $this->drupalPostForm(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, 'Save');
$this->assertSession()->statusCodeEquals(200);
// Make sure that the action updated properly.
@@ -74,7 +74,7 @@ public function testAssignOwnerNodeActionConfiguration() {
$this->clickLink(t('Delete'));
$this->assertSession()->statusCodeEquals(200);
$edit = [];
- $this->drupalPostForm(NULL, $edit, t('Delete'));
+ $this->drupalPostForm(NULL, $edit, 'Delete');
$this->assertSession()->statusCodeEquals(200);
// Make sure that the action was actually deleted.
diff --git a/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php b/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php
index 8e9a8730d69694c8afa31a0cce288585e7407e8b..e792ee2b4e11cd0a465ebc39c0402e7a4c6e08d4 100644
--- a/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php
+++ b/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php
@@ -147,7 +147,7 @@ public function testRecentNodeBlock() {
'visibility[node_type][bundles][article]' => 'article',
];
$theme = \Drupal::service('theme_handler')->getDefault();
- $this->drupalPostForm("admin/structure/block/add/system_powered_by_block/$theme", $edit, t('Save block'));
+ $this->drupalPostForm("admin/structure/block/add/system_powered_by_block/$theme", $edit, 'Save block');
$block = Block::load($edit['id']);
$visibility = $block->getVisibility();
@@ -204,7 +204,7 @@ public function testRecentNodeBlock() {
$this->assertSession()->pageTextContains('Displaying node #' . $node1->id() . ', revision #' . $node1->getRevisionId() . ': Node revision 2 title');
// Assert that the preview page displays the block as well.
- $this->drupalPostForm('node/' . $node1->id() . '/edit', [], t('Preview'));
+ $this->drupalPostForm('node/' . $node1->id() . '/edit', [], 'Preview');
$this->assertSession()->pageTextContains($label);
// The previewed node object has no revision ID.
$this->assertSession()->pageTextContains('Displaying node #' . $node1->id() . ', revision #: Node revision 2 title');
diff --git a/core/modules/node/tests/src/Functional/NodeCreationTest.php b/core/modules/node/tests/src/Functional/NodeCreationTest.php
index f26e04f104fc2e138ed7e8db8271728236cf5a00..4aac7dfe8af9e448f617b32237862d3cd9f769d2 100644
--- a/core/modules/node/tests/src/Functional/NodeCreationTest.php
+++ b/core/modules/node/tests/src/Functional/NodeCreationTest.php
@@ -57,7 +57,7 @@ public function testNodeCreation() {
$edit = [];
$edit['title[0][value]'] = $this->randomMachineName(8);
$edit['body[0][value]'] = $this->randomMachineName(16);
- $this->drupalPostForm('node/add/page', $edit, t('Save'));
+ $this->drupalPostForm('node/add/page', $edit, 'Save');
// Check that the Basic page has been created.
$this->assertText('Basic page ' . $edit['title[0][value]'] . ' has been created.', 'Basic page created.');
@@ -143,7 +143,7 @@ public function testUnpublishedNodeCreation() {
$edit = [];
$edit['title[0][value]'] = $this->randomMachineName(8);
$edit['body[0][value]'] = $this->randomMachineName(16);
- $this->drupalPostForm('node/add/page', $edit, t('Save'));
+ $this->drupalPostForm('node/add/page', $edit, 'Save');
// Check that the user was redirected to the home page.
$this->assertSession()->addressEquals('');
diff --git a/core/modules/node/tests/src/Functional/NodeEditFormTest.php b/core/modules/node/tests/src/Functional/NodeEditFormTest.php
index 1df1353e727145449c0a65a7ef572817cf80f98a..8825393ed9e881f6deeb9ddaa41190cc51e2b2e6 100644
--- a/core/modules/node/tests/src/Functional/NodeEditFormTest.php
+++ b/core/modules/node/tests/src/Functional/NodeEditFormTest.php
@@ -73,7 +73,7 @@ public function testNodeEdit() {
$edit = [];
$edit[$title_key] = $this->randomMachineName(8);
$edit[$body_key] = $this->randomMachineName(16);
- $this->drupalPostForm('node/add/page', $edit, t('Save'));
+ $this->drupalPostForm('node/add/page', $edit, 'Save');
// Check that the node exists in the database.
$node = $this->drupalGetNodeByTitle($edit[$title_key]);
@@ -94,7 +94,7 @@ public function testNodeEdit() {
$edit[$title_key] = $this->randomMachineName(8);
$edit[$body_key] = $this->randomMachineName(16);
// Stay on the current page, without reloading.
- $this->drupalPostForm(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, 'Save');
// Check that the title and body fields are displayed with the updated values.
$this->assertText($edit[$title_key], 'Title displayed.');
@@ -112,7 +112,7 @@ public function testNodeEdit() {
$edit['title[0][value]'] = $this->randomMachineName(8);
$edit[$body_key] = $this->randomMachineName(16);
$edit['revision'] = TRUE;
- $this->drupalPostForm(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, 'Save');
// Ensure that the node revision has been created.
$revised_node = $this->drupalGetNodeByTitle($edit['title[0][value]'], TRUE);
@@ -138,7 +138,7 @@ public function testNodeEdit() {
$edit['created[0][value][date]'] = $this->randomMachineName(8);
// Get the current amount of open details elements.
$open_details_elements = count($this->cssSelect('details[open="open"]'));
- $this->drupalPostForm(NULL, $edit, t('Save'));
+ $this->drupalPostForm(NULL, $edit, 'Save');
// The node author details must be open.
$this->assertRaw('