diff --git a/modules/paragraphs_type_permissions/src/Tests/ParagraphsTypePermissionsTest.php b/modules/paragraphs_type_permissions/src/Tests/ParagraphsTypePermissionsTest.php index a13e829..c509293 100644 --- a/modules/paragraphs_type_permissions/src/Tests/ParagraphsTypePermissionsTest.php +++ b/modules/paragraphs_type_permissions/src/Tests/ParagraphsTypePermissionsTest.php @@ -138,7 +138,7 @@ class ParagraphsTypePermissionsTest extends WebTestBase { $edit = [ 'field_paragraphs_demo[0][subform][status][value]' => FALSE, ]; - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Save')); // Check that 'Image + Text' paragraph is not shown anymore for admin user. $this->assertNoRaw($image_text_tag); diff --git a/src/Tests/Classic/ParagraphsAccessTest.php b/src/Tests/Classic/ParagraphsAccessTest.php index b31d6b6..3b19e52 100644 --- a/src/Tests/Classic/ParagraphsAccessTest.php +++ b/src/Tests/Classic/ParagraphsAccessTest.php @@ -138,7 +138,7 @@ class ParagraphsAccessTest extends ParagraphsTestBase { // Delete the Paragraph and save. $this->drupalPostAjaxForm(NULL, [], 'field_paragraphs_demo_0_remove'); $this->drupalPostAjaxForm(NULL, [], 'field_paragraphs_demo_0_confirm_remove'); - $this->drupalPostForm(NULL, [], t('Save and keep published')); + $this->drupalPostForm(NULL, [], t('Save')); $node = $this->getNodeByTitle('delete_permissions'); $this->assertUrl('node/' . $node->id()); } diff --git a/src/Tests/Classic/ParagraphsAdministrationTest.php b/src/Tests/Classic/ParagraphsAdministrationTest.php index 347ff52..69f231e 100644 --- a/src/Tests/Classic/ParagraphsAdministrationTest.php +++ b/src/Tests/Classic/ParagraphsAdministrationTest.php @@ -85,7 +85,7 @@ class ParagraphsAdministrationTest extends ParagraphsTestBase { 'field_paragraphs[0][subform][field_text][0][value]' => 'Foo Bar 1', 'revision' => FALSE, ]; - $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save and keep published')); + $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save')); $this->countRevisions($node, $paragraph1, $paragraph2, 1); @@ -96,7 +96,7 @@ class ParagraphsAdministrationTest extends ParagraphsTestBase { 'field_paragraphs[0][subform][field_text][0][value]' => 'Foo Bar 2', 'revision' => TRUE, ]; - $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save and keep published')); + $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save')); $this->countRevisions($node, $paragraph1, $paragraph2, 2); @@ -325,7 +325,7 @@ class ParagraphsAdministrationTest extends ParagraphsTestBase { 'field_paragraphs[0][subform][field_image][0][width]' => 300, 'field_paragraphs[0][subform][field_image][0][height]' => 300, ]; - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Save')); // Assert the paragraph is deleted after the user saves the node. $this->drupalGet('node/' . $node->id() . '/edit'); $this->assertNoRaw('myImage2.jpg'); @@ -356,7 +356,7 @@ class ParagraphsAdministrationTest extends ParagraphsTestBase { $edit = [ 'field_paragraphs[0][subform][status][value]' => FALSE, ]; - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Save')); $this->assertNoText(t('Example published and unpublished')); // Set the fields as required. @@ -493,7 +493,7 @@ class ParagraphsAdministrationTest extends ParagraphsTestBase { // Restore the Paragraph and fix the broken reference. $this->drupalPostAjaxForm(NULL, [], 'field_paragraphs_0_restore'); $node = $this->drupalGetNodeByTitle('Example publish/unpublish'); - $this->drupalPostForm(NULL, ['field_paragraphs[0][subform][field_entity_reference][0][target_id]' => $node->label() . ' (' . $node->id() . ')'], t('Save and keep published')); + $this->drupalPostForm(NULL, ['field_paragraphs[0][subform][field_entity_reference][0][target_id]' => $node->label() . ' (' . $node->id() . ')'], t('Save')); $this->assertText('choke test has been updated.'); $this->assertLink('Example publish/unpublish'); // Delete the new referenced node. @@ -508,14 +508,14 @@ class ParagraphsAdministrationTest extends ParagraphsTestBase { // Attempt to edit the Paragraph. $this->drupalPostAjaxForm('node/' . $node->id() . '/edit', [], 'field_paragraphs_0_edit'); // Try to save with an invalid reference. - $this->drupalPostForm(NULL, ['field_paragraphs[0][subform][field_entity_reference][0][target_id]' => 'foo'], t('Save and keep published')); + $this->drupalPostForm(NULL, ['field_paragraphs[0][subform][field_entity_reference][0][target_id]' => 'foo'], t('Save')); $this->assertText('There are no entities matching "foo".'); // Remove the Paragraph and save the node. $this->drupalPostAjaxForm(NULL, [], 'field_paragraphs_0_remove'); $elements = $this->xpath('//*[@name="field_paragraphs_0_confirm_remove"]'); $this->assertTrue(!empty($elements), "'Confirm removal' button appears."); $this->drupalPostAjaxForm(NULL, [], 'field_paragraphs_0_confirm_remove'); - $this->drupalPostForm(NULL, [], t('Save and keep published')); + $this->drupalPostForm(NULL, [], t('Save')); $this->assertText('choke test has been updated.'); // Verify that the text displayed is correct when no paragraph has been diff --git a/src/Tests/Classic/ParagraphsConfigTest.php b/src/Tests/Classic/ParagraphsConfigTest.php index 5881992..594de16 100644 --- a/src/Tests/Classic/ParagraphsConfigTest.php +++ b/src/Tests/Classic/ParagraphsConfigTest.php @@ -59,7 +59,7 @@ class ParagraphsConfigTest extends ParagraphsTestBase { $this->drupalGet('node/' . $node->id() . '/translations'); $this->clickLink(t('Add')); // Save the translation. - $this->drupalPostForm(NULL, [], t('Save and keep published (this translation)')); + $this->drupalPostForm(NULL, [], t('Save (this translation)')); $this->assertText('paragraphed_test paragraphed_title has been updated.'); } diff --git a/src/Tests/Classic/ParagraphsEditModesTest.php b/src/Tests/Classic/ParagraphsEditModesTest.php index b4061e8..7d8d91c 100644 --- a/src/Tests/Classic/ParagraphsEditModesTest.php +++ b/src/Tests/Classic/ParagraphsEditModesTest.php @@ -79,7 +79,7 @@ class ParagraphsEditModesTest extends ParagraphsTestBase { // Remove image. $this->drupalPostAjaxForm(NULL, [], 'field_paragraphs_0_edit'); $this->drupalPostAjaxForm(NULL, [], 'field_paragraphs_0_subform_field_image_0_remove_button'); - $this->drupalPostForm(NULL, [], t('Save and keep published')); + $this->drupalPostForm(NULL, [], t('Save')); // Assert the summary is correctly generated. $this->clickLink(t('Edit')); diff --git a/src/Tests/Classic/ParagraphsInlineEntityFormTest.php b/src/Tests/Classic/ParagraphsInlineEntityFormTest.php index f8a2922..252d8d0 100644 --- a/src/Tests/Classic/ParagraphsInlineEntityFormTest.php +++ b/src/Tests/Classic/ParagraphsInlineEntityFormTest.php @@ -136,7 +136,7 @@ class ParagraphsInlineEntityFormTest extends ParagraphsTestBase { 'field_paragraphs[0][_weight]' => -1, 'field_paragraphs[1][_weight]' => -2, ]; - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Save')); } } diff --git a/src/Tests/Classic/ParagraphsPreviewTest.php b/src/Tests/Classic/ParagraphsPreviewTest.php index 5030e0e..b185d6f 100644 --- a/src/Tests/Classic/ParagraphsPreviewTest.php +++ b/src/Tests/Classic/ParagraphsPreviewTest.php @@ -91,7 +91,7 @@ class ParagraphsPreviewTest extends ParagraphsTestBase { $paragraph_2 = $this->xpath('//*[@id="edit-field-paragraphs-1-subform-field-text-0-value"]')[0]; $this->assertEqual($paragraph_1['value'], $test_text_1); $this->assertEqual($paragraph_2['value'], $new_test_text_2); - $this->drupalPostForm(NULL, [], t('Save and keep published')); + $this->drupalPostForm(NULL, [], t('Save')); $this->assertRaw($test_text_1); $this->assertRaw($new_test_text_2); diff --git a/src/Tests/Classic/ParagraphsSummaryFormatterTest.php b/src/Tests/Classic/ParagraphsSummaryFormatterTest.php index c653a74..2a430cd 100644 --- a/src/Tests/Classic/ParagraphsSummaryFormatterTest.php +++ b/src/Tests/Classic/ParagraphsSummaryFormatterTest.php @@ -63,7 +63,7 @@ class ParagraphsSummaryFormatterTest extends ParagraphsTestBase { $edit = [ 'field_paragraphs[2][subform][field_user][0][target_id]' => $this->admin_user->label() . ' (' . $this->admin_user->id() . ')', ]; - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Save')); // Assert the summary is correctly generated. $this->assertText($this->admin_user->label()); diff --git a/src/Tests/Classic/ParagraphsTranslationTest.php b/src/Tests/Classic/ParagraphsTranslationTest.php index 06169f8..08bdcba 100644 --- a/src/Tests/Classic/ParagraphsTranslationTest.php +++ b/src/Tests/Classic/ParagraphsTranslationTest.php @@ -102,7 +102,7 @@ class ParagraphsTranslationTest extends ParagraphsTestBase { 'field_paragraphs_demo[0][subform][status][value]' => FALSE, 'field_paragraphs_demo[1][subform][field_paragraphs_demo][0][subform][field_text_demo][0][value]' => 'Dummy text' ]; - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Save')); $this->assertNoText(t('Example published and unpublished')); // Check the parent fields are set properly. Get the node. @@ -155,7 +155,7 @@ class ParagraphsTranslationTest extends ParagraphsTestBase { 'revision' => TRUE, 'revision_log[0][value]' => 'french 1', ); - $this->drupalPostForm(NULL, $edit, t('Save and keep published (this translation)')); + $this->drupalPostForm(NULL, $edit, t('Save (this translation)')); $this->assertText('Paragraphed article Title in french has been updated.'); // Check the english translation. @@ -180,7 +180,7 @@ class ParagraphsTranslationTest extends ParagraphsTestBase { 'revision' => TRUE, 'revision_log[0][value]' => 'french 2', ); - $this->drupalPostForm(NULL, $edit, t('Save and keep published (this translation)')); + $this->drupalPostForm(NULL, $edit, t('Save (this translation)')); $this->assertText('Title Change in french'); $this->assertText('New text in french'); @@ -190,7 +190,7 @@ class ParagraphsTranslationTest extends ParagraphsTestBase { $this->assertText('Title in english'); $this->assertText('Text in english'); // Save the original content on second request. - $this->drupalPostForm(NULL, NULL, t('Save and keep published (this translation)')); + $this->drupalPostForm(NULL, NULL, t('Save (this translation)')); $this->assertText('Paragraphed article Title in english has been updated.'); // Test if reverting to old paragraphs revisions works, make sure that @@ -201,7 +201,7 @@ class ParagraphsTranslationTest extends ParagraphsTestBase { $this->clickLink(t('Edit')); $this->assertRaw('Title in french'); $this->assertText('Text in french'); - $this->drupalPostForm(NULL, [], t('Save and keep published (this translation)')); + $this->drupalPostForm(NULL, [], t('Save (this translation)')); $this->assertNoRaw('The content has either been modified by another user, or you have already submitted modifications'); $this->assertText('Text in french'); @@ -245,7 +245,7 @@ class ParagraphsTranslationTest extends ParagraphsTestBase { 'field_paragraphs_demo[0][subform][field_images_demo][0][alt]' => 'Image alt FR', 'field_paragraphs_demo[0][subform][field_images_demo][0][title]' => 'Image title FR', ]; - $this->drupalPostForm(NULL, $edit, t('Save and keep published (this translation)')); + $this->drupalPostForm(NULL, $edit, t('Save (this translation)')); $this->assertRaw('Title FR'); $this->drupalGet('node/add/paragraphed_content_demo'); @@ -288,7 +288,7 @@ class ParagraphsTranslationTest extends ParagraphsTestBase { 'field_paragraphs_demo' => [$paragraph_1, $translated_paragraph], ]); $this->drupalGet('node/' . $node->id() . '/edit'); - $this->drupalPostForm(NULL, [], t('Save and keep published')); + $this->drupalPostForm(NULL, [], t('Save')); $this->assertText('Paragraphed article ' . $node->label() . ' has been updated.'); // Check that first paragraph langcode has been updated. $paragraph = Paragraph::load($paragraph_1->id()); @@ -305,7 +305,7 @@ class ParagraphsTranslationTest extends ParagraphsTestBase { 'field_paragraphs_demo[0][subform][field_text_demo][0][value]' => 'english_translation_1', 'field_paragraphs_demo[1][subform][field_text_demo][0][value]' => 'english_translation_2', ]; - $this->drupalPostForm('node/' . $node->id() . '/translations/add/de/en', $edit, t('Save and keep published (this translation)')); + $this->drupalPostForm('node/' . $node->id() . '/translations/add/de/en', $edit, t('Save (this translation)')); // Attempt to create a french translation. $this->drupalGet('node/' . $node->id() . '/translations/add/de/fr'); // Check that the german translation of the paragraphs is displayed. @@ -416,7 +416,7 @@ class ParagraphsTranslationTest extends ParagraphsTestBase { $edit = [ 'title[0][value]' => 'Title in french', ]; - $this->drupalPostForm(NULL, $edit, t('Save and keep published (this translation)')); + $this->drupalPostForm(NULL, $edit, t('Save (this translation)')); $this->assertParagraphsLangcode($node->id(), 'en', 'fr'); $this->assertText('Paragraphed article Title in french has been updated.'); $this->assertText('Title in french'); @@ -434,7 +434,7 @@ class ParagraphsTranslationTest extends ParagraphsTestBase { // check that the paragraphs buttons are still hidden. $this->assertParagraphsLangcode($node->id(), 'en', 'fr'); $this->assertNoParagraphsButtons(1); - $this->drupalPostForm(NULL, NULL, t('Save and keep published (this translation)')); + $this->drupalPostForm(NULL, NULL, t('Save (this translation)')); $this->assertText('Title in french'); $this->assertNoText('Title in english'); @@ -469,7 +469,7 @@ class ParagraphsTranslationTest extends ParagraphsTestBase { ], t('Upload')); $this->assertParagraphsLangcode($node->id()); $this->assertParagraphsButtons(2); - $this->drupalPostForm(NULL, NULL, t('Save and keep published (this translation)')); + $this->drupalPostForm(NULL, NULL, t('Save (this translation)')); $this->assertText('Title in english (de)'); $this->assertNoText('Title in french'); // Check the original node and the paragraphs langcode are now 'de'. @@ -515,7 +515,7 @@ class ParagraphsTranslationTest extends ParagraphsTestBase { // check that the paragraphs buttons are still hidden. $this->assertParagraphsLangcode($node->id(), 'de', 'fr'); $this->assertNoParagraphsButtons(2); - $this->drupalPostForm(NULL, NULL, t('Save and keep published (this translation)')); + $this->drupalPostForm(NULL, NULL, t('Save (this translation)')); // Check the paragraphs langcode are still 'de' after saving the translation. $this->assertParagraphsLangcode($node->id(), 'de', 'fr'); $this->assertText('Title in french'); @@ -547,7 +547,7 @@ class ParagraphsTranslationTest extends ParagraphsTestBase { ], t('Upload')); $this->assertParagraphsLangcode($node->id(), 'de'); $this->assertParagraphsButtons(3); - $this->drupalPostForm(NULL, NULL, t('Save and keep published (this translation)')); + $this->drupalPostForm(NULL, NULL, t('Save (this translation)')); // Check the original node and the paragraphs langcode are now 'en'. $this->assertParagraphsLangcode($node->id()); } @@ -605,7 +605,7 @@ class ParagraphsTranslationTest extends ParagraphsTestBase { // Check the paragraph langcode is still 'de' and its buttons are shown. $this->assertParagraphsLangcode($node1->id(), 'de'); $this->assertParagraphsButtons(1); - $this->drupalPostForm(NULL, NULL, t('Save and keep published')); + $this->drupalPostForm(NULL, NULL, t('Save')); // Check the paragraph langcode is now 'en' after saving. $this->assertParagraphsLangcode($node1->id()); @@ -661,7 +661,7 @@ class ParagraphsTranslationTest extends ParagraphsTestBase { ], t('Upload')); $this->assertParagraphsLangcode($node2->id()); $this->assertParagraphsButtons(2); - $this->drupalPostForm(NULL, NULL, t('Save and keep published')); + $this->drupalPostForm(NULL, NULL, t('Save')); // Check the paragraphs langcode are now 'de' after saving. $this->assertParagraphsLangcode($node2->id(), 'de'); @@ -671,7 +671,7 @@ class ParagraphsTranslationTest extends ParagraphsTestBase { 'title[0][value]' => 'Title in english', 'langcode[0][value]' => 'en', ]; - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Save')); // Check the paragraphs langcode are now 'en' after saving. $this->assertParagraphsLangcode($node2->id()); @@ -701,7 +701,7 @@ class ParagraphsTranslationTest extends ParagraphsTestBase { ], t('Upload')); $this->assertParagraphsLangcode($node2->id()); $this->assertParagraphsButtons(3); - $this->drupalPostForm(NULL, NULL, t('Save and keep published')); + $this->drupalPostForm(NULL, NULL, t('Save')); // Check the paragraphs langcode are still 'en' after saving. $this->assertParagraphsLangcode($node2->id()); @@ -726,7 +726,7 @@ class ParagraphsTranslationTest extends ParagraphsTestBase { ], t('Upload')); $this->assertParagraphsLangcode($node2->id()); $this->assertParagraphsButtons(4); - $this->drupalPostForm(NULL, NULL, t('Save and keep published')); + $this->drupalPostForm(NULL, NULL, t('Save')); // Check the paragraphs langcode are now 'de' after saving. $this->assertParagraphsLangcode($node2->id(), 'de'); } diff --git a/src/Tests/Classic/ParagraphsWidgetButtonsTest.php b/src/Tests/Classic/ParagraphsWidgetButtonsTest.php index 7f5789e..d9ee815 100644 --- a/src/Tests/Classic/ParagraphsWidgetButtonsTest.php +++ b/src/Tests/Classic/ParagraphsWidgetButtonsTest.php @@ -42,7 +42,7 @@ class ParagraphsWidgetButtonsTest extends ParagraphsTestBase { // Test the 'Open' mode. $this->drupalGet('node/' . $node->id() . '/edit'); $this->assertFieldByName('field_paragraphs[0][subform][field_text][0][value]', $text); - $this->drupalPostForm(NULL, [], t('Save and keep published')); + $this->drupalPostForm(NULL, [], t('Save')); $this->assertText($text); // Test the 'Closed' mode. @@ -61,7 +61,7 @@ class ParagraphsWidgetButtonsTest extends ParagraphsTestBase { // Verify that we have warning message for each paragraph. $this->assertNoUniqueText('You have unsaved changes on this Paragraph item.'); $this->assertRaw('
' . $closed_mode_text); - $this->drupalPostForm(NULL, [], t('Save and keep published')); + $this->drupalPostForm(NULL, [], t('Save')); $this->assertText('paragraphed_test ' . $node->label() . ' has been updated.'); $this->assertText($closed_mode_text); @@ -77,7 +77,7 @@ class ParagraphsWidgetButtonsTest extends ParagraphsTestBase { $this->drupalPostAjaxForm(NULL, $edit, 'field_paragraphs_0_collapse'); $this->assertText('You have unsaved changes on this Paragraph item.'); $this->assertText($preview_mode_text); - $this->drupalPostForm(NULL, [], t('Save and keep published')); + $this->drupalPostForm(NULL, [], t('Save')); $this->assertText('paragraphed_test ' . $node->label() . ' has been updated.'); $this->assertText($preview_mode_text); @@ -92,7 +92,7 @@ class ParagraphsWidgetButtonsTest extends ParagraphsTestBase { $this->assertFieldByName('field_paragraphs[0][subform][field_text][0][value]', $preview_mode_text); $restore_text = 'restore_text'; $edit = ['field_paragraphs[0][subform][field_text][0][value]' => $restore_text]; - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Save')); $this->assertText('paragraphed_test ' . $node->label() . ' has been updated.'); $this->assertText($restore_text); @@ -104,7 +104,7 @@ class ParagraphsWidgetButtonsTest extends ParagraphsTestBase { $this->assertText('Deleted Paragraph: text_paragraph'); // Click "Confirm Removal" button. $this->drupalPostAjaxForm(NULL, [], 'field_paragraphs_0_confirm_remove'); - $this->drupalPostForm(NULL, [], t('Save and keep published')); + $this->drupalPostForm(NULL, [], t('Save')); $this->assertText('paragraphed_test ' . $node->label() . ' has been updated.'); $this->assertNoText($restore_text); } diff --git a/src/Tests/Experimental/ParagraphsExperimentalAccessTest.php b/src/Tests/Experimental/ParagraphsExperimentalAccessTest.php index f2d0fdf..a17989b 100644 --- a/src/Tests/Experimental/ParagraphsExperimentalAccessTest.php +++ b/src/Tests/Experimental/ParagraphsExperimentalAccessTest.php @@ -136,7 +136,7 @@ class ParagraphsExperimentalAccessTest extends ParagraphsExperimentalTestBase { $this->assertNotNull($this->xpath('//*[@name="field_paragraphs_demo_0_remove"]')); // Delete the Paragraph and save. $this->drupalPostAjaxForm(NULL, [], 'field_paragraphs_demo_0_remove'); - $this->drupalPostForm(NULL, [], t('Save and keep published')); + $this->drupalPostForm(NULL, [], t('Save')); $node = $this->getNodeByTitle('delete_permissions'); $this->assertUrl('node/' . $node->id()); } diff --git a/src/Tests/Experimental/ParagraphsExperimentalAdministrationTest.php b/src/Tests/Experimental/ParagraphsExperimentalAdministrationTest.php index 9759be5..8d558f1 100644 --- a/src/Tests/Experimental/ParagraphsExperimentalAdministrationTest.php +++ b/src/Tests/Experimental/ParagraphsExperimentalAdministrationTest.php @@ -86,7 +86,7 @@ class ParagraphsExperimentalAdministrationTest extends ParagraphsExperimentalTes 'field_paragraphs[0][subform][field_text][0][value]' => 'Foo Bar 1', 'revision' => FALSE, ]; - $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save and keep published')); + $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save')); $this->countRevisions($node, $paragraph1, $paragraph2, 1); @@ -97,7 +97,7 @@ class ParagraphsExperimentalAdministrationTest extends ParagraphsExperimentalTes 'field_paragraphs[0][subform][field_text][0][value]' => 'Foo Bar 2', 'revision' => TRUE, ]; - $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save and keep published')); + $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save')); $this->countRevisions($node, $paragraph1, $paragraph2, 2); @@ -321,7 +321,7 @@ class ParagraphsExperimentalAdministrationTest extends ParagraphsExperimentalTes 'field_paragraphs[0][subform][field_image][0][width]' => 300, 'field_paragraphs[0][subform][field_image][0][height]' => 300, ]; - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Save')); // Assert the paragraph is deleted after the user saves the node. $this->drupalGet('node/' . $node->id() . '/edit'); $this->assertNoRaw('myImage2.jpg'); @@ -352,7 +352,7 @@ class ParagraphsExperimentalAdministrationTest extends ParagraphsExperimentalTes $edit = [ 'field_paragraphs[0][subform][status][value]' => FALSE, ]; - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Save')); $this->assertNoText(t('Example published and unpublished')); // Set the fields as required. @@ -484,7 +484,7 @@ class ParagraphsExperimentalAdministrationTest extends ParagraphsExperimentalTes $this->assertText('There are no entities matching "foo".'); // Fix the broken reference. $node = $this->drupalGetNodeByTitle('Example publish/unpublish'); - $this->drupalPostForm(NULL, ['field_paragraphs[0][subform][field_entity_reference][0][target_id]' => $node->label() . ' (' . $node->id() . ')'], t('Save and keep published')); + $this->drupalPostForm(NULL, ['field_paragraphs[0][subform][field_entity_reference][0][target_id]' => $node->label() . ' (' . $node->id() . ')'], t('Save')); $this->assertText('choke test has been updated.'); $this->assertLink('Example publish/unpublish'); // Delete the new referenced node. @@ -499,11 +499,11 @@ class ParagraphsExperimentalAdministrationTest extends ParagraphsExperimentalTes // Attempt to edit the Paragraph. $this->drupalPostAjaxForm('node/' . $node->id() . '/edit', [], 'field_paragraphs_0_edit'); // Try to save with and invalid reference. - $this->drupalPostForm(NULL, ['field_paragraphs[0][subform][field_entity_reference][0][target_id]' => 'foo'], t('Save and keep published')); + $this->drupalPostForm(NULL, ['field_paragraphs[0][subform][field_entity_reference][0][target_id]' => 'foo'], t('Save')); $this->assertText('There are no entities matching "foo".'); // Remove the Paragraph and save the node. $this->drupalPostAjaxForm(NULL, [], 'field_paragraphs_0_remove'); - $this->drupalPostForm(NULL, [], t('Save and keep published')); + $this->drupalPostForm(NULL, [], t('Save')); $this->assertText('choke test has been updated.'); // Verify that the text displayed is correct when no paragraph has been diff --git a/src/Tests/Experimental/ParagraphsExperimentalBehaviorsTest.php b/src/Tests/Experimental/ParagraphsExperimentalBehaviorsTest.php index f4d0736..fcfe973 100644 --- a/src/Tests/Experimental/ParagraphsExperimentalBehaviorsTest.php +++ b/src/Tests/Experimental/ParagraphsExperimentalBehaviorsTest.php @@ -121,7 +121,7 @@ class ParagraphsExperimentalBehaviorsTest extends ParagraphsExperimentalTestBase 'field_paragraphs[0][behavior_plugins][test_text_color][text_color]' => $updated_text, 'field_paragraphs[0][behavior_plugins][test_bold_text][bold_text]' => TRUE, ]; - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Save')); $this->assertNoRaw('class="red_plugin_text'); $this->assertRaw('class="blue_plugin_text bold_plugin_text'); $this->clickLink('Edit'); @@ -139,7 +139,7 @@ class ParagraphsExperimentalBehaviorsTest extends ParagraphsExperimentalTestBase $this->assertNoFieldByName('field_paragraphs[0][behavior_plugins][test_text_color][text_color]', $updated_text); $this->assertNoFieldByName('field_paragraphs[0][behavior_plugins][test_bold_text][bold_text]', TRUE); - $this->drupalPostForm(NULL, [], t('Save and keep published')); + $this->drupalPostForm(NULL, [], t('Save')); // Make sure that values don't change if a user without the 'edit behavior // plugin settings' permission saves a node with paragraphs and enabled @@ -298,7 +298,7 @@ class ParagraphsExperimentalBehaviorsTest extends ParagraphsExperimentalTestBase 'field_paragraphs[0][_weight]' => 1, 'field_paragraphs[1][_weight]' => 0, ]; - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Save')); $this->assertNoErrorsLogged(); } diff --git a/src/Tests/Experimental/ParagraphsExperimentalConfigTest.php b/src/Tests/Experimental/ParagraphsExperimentalConfigTest.php index 2297903..07bb67c 100644 --- a/src/Tests/Experimental/ParagraphsExperimentalConfigTest.php +++ b/src/Tests/Experimental/ParagraphsExperimentalConfigTest.php @@ -60,7 +60,7 @@ class ParagraphsExperimentalConfigTest extends ParagraphsExperimentalTestBase { $this->drupalGet('node/' . $node->id() . '/translations'); $this->clickLink(t('Add')); // Save the translation. - $this->drupalPostForm(NULL, [], t('Save and keep published (this translation)')); + $this->drupalPostForm(NULL, [], t('Save (this translation)')); $this->assertText('paragraphed_test paragraphed_title has been updated.'); } diff --git a/src/Tests/Experimental/ParagraphsExperimentalDuplicateFeatureTest.php b/src/Tests/Experimental/ParagraphsExperimentalDuplicateFeatureTest.php index 57beab2..718ed4a 100644 --- a/src/Tests/Experimental/ParagraphsExperimentalDuplicateFeatureTest.php +++ b/src/Tests/Experimental/ParagraphsExperimentalDuplicateFeatureTest.php @@ -53,7 +53,7 @@ class ParagraphsExperimentalDuplicateFeatureTest extends ParagraphsExperimentalT $this->assertFieldByName('field_paragraphs[1][subform][field_text][0][value]', $text); // Save and check if both paragraphs are present. - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Save')); $this->assertNoUniqueText($text); } @@ -94,7 +94,7 @@ class ParagraphsExperimentalDuplicateFeatureTest extends ParagraphsExperimentalT $edit = [ 'field_paragraphs[0][subform][field_nested][0][subform][field_text][0][value]' => $text, ]; - $this->drupalPostForm(NULL, $edit, 'Save and keep published'); + $this->drupalPostForm(NULL, $edit, 'Save'); // Switch mode to closed. $this->setParagraphsWidgetMode('paragraphed_test', 'field_paragraphs', 'closed'); @@ -114,7 +114,7 @@ class ParagraphsExperimentalDuplicateFeatureTest extends ParagraphsExperimentalT // Save and check if the changed text paragraph value of the duplicated // paragraph is not the same as in the original paragraph. - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Save')); $this->assertUniqueText($text); $this->assertUniqueText($second_paragraph_text); } diff --git a/src/Tests/Experimental/ParagraphsExperimentalEditModesTest.php b/src/Tests/Experimental/ParagraphsExperimentalEditModesTest.php index 2fc3076..39f17ab 100644 --- a/src/Tests/Experimental/ParagraphsExperimentalEditModesTest.php +++ b/src/Tests/Experimental/ParagraphsExperimentalEditModesTest.php @@ -69,7 +69,7 @@ class ParagraphsExperimentalEditModesTest extends ParagraphsExperimentalTestBase $edit = [ 'field_paragraphs[2][subform][field_user][0][target_id]' => $this->admin_user->label() . ' (' . $this->admin_user->id() . ')', ]; - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Save')); // Assert the summary is correctly generated. $this->clickLink(t('Edit')); @@ -91,7 +91,7 @@ class ParagraphsExperimentalEditModesTest extends ParagraphsExperimentalTestBase // Remove image. $this->drupalPostAjaxForm(NULL, [], 'field_paragraphs_0_edit'); $this->drupalPostAjaxForm(NULL, [], 'field_paragraphs_0_subform_field_image_0_remove_button'); - $this->drupalPostForm(NULL, [], t('Save and keep published')); + $this->drupalPostForm(NULL, [], t('Save')); // Assert the summary is correctly generated. $this->clickLink(t('Edit')); diff --git a/src/Tests/Experimental/ParagraphsExperimentalInlineEntityFormTest.php b/src/Tests/Experimental/ParagraphsExperimentalInlineEntityFormTest.php index 653da46..aaf6ab1 100644 --- a/src/Tests/Experimental/ParagraphsExperimentalInlineEntityFormTest.php +++ b/src/Tests/Experimental/ParagraphsExperimentalInlineEntityFormTest.php @@ -135,7 +135,7 @@ class ParagraphsExperimentalInlineEntityFormTest extends ParagraphsExperimentalT 'field_paragraphs[0][_weight]' => -1, 'field_paragraphs[1][_weight]' => -2, ]; - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Save')); } } diff --git a/src/Tests/Experimental/ParagraphsExperimentalPreviewTest.php b/src/Tests/Experimental/ParagraphsExperimentalPreviewTest.php index f7bc552..2ef547b 100644 --- a/src/Tests/Experimental/ParagraphsExperimentalPreviewTest.php +++ b/src/Tests/Experimental/ParagraphsExperimentalPreviewTest.php @@ -92,7 +92,7 @@ class ParagraphsExperimentalPreviewTest extends ParagraphsExperimentalTestBase { $paragraph_2 = $this->xpath('//*[@id="edit-field-paragraphs-1-subform-field-text-0-value"]')[0]; $this->assertEqual($paragraph_1['value'], $test_text_1); $this->assertEqual($paragraph_2['value'], $new_test_text_2); - $this->drupalPostForm(NULL, [], t('Save and keep published')); + $this->drupalPostForm(NULL, [], t('Save')); $this->assertRaw($test_text_1); $this->assertRaw($new_test_text_2); diff --git a/src/Tests/Experimental/ParagraphsExperimentalSummaryFormatterTest.php b/src/Tests/Experimental/ParagraphsExperimentalSummaryFormatterTest.php index bdb53e7..3ee0495 100644 --- a/src/Tests/Experimental/ParagraphsExperimentalSummaryFormatterTest.php +++ b/src/Tests/Experimental/ParagraphsExperimentalSummaryFormatterTest.php @@ -62,7 +62,7 @@ class ParagraphsExperimentalSummaryFormatterTest extends ParagraphsExperimentalT $edit = [ 'field_paragraphs[2][subform][field_user][0][target_id]' => $this->admin_user->label() . ' (' . $this->admin_user->id() . ')', ]; - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Save')); // Assert the summary is correctly generated. $this->assertText($this->admin_user->label()); diff --git a/src/Tests/Experimental/ParagraphsExperimentalTranslationTest.php b/src/Tests/Experimental/ParagraphsExperimentalTranslationTest.php index d1644ef..36cc74a 100644 --- a/src/Tests/Experimental/ParagraphsExperimentalTranslationTest.php +++ b/src/Tests/Experimental/ParagraphsExperimentalTranslationTest.php @@ -98,7 +98,7 @@ class ParagraphsExperimentalTranslationTest extends ParagraphsExperimentalTestBa 'field_paragraphs_demo[0][subform][status][value]' => FALSE, 'field_paragraphs_demo[1][subform][field_paragraphs_demo][0][subform][field_text_demo][0][value]' => 'Dummy text' ]; - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Save')); $this->assertNoText(t('Example published and unpublished')); // Check the parent fields are set properly. Get the node. @@ -151,7 +151,7 @@ class ParagraphsExperimentalTranslationTest extends ParagraphsExperimentalTestBa 'revision' => TRUE, 'revision_log[0][value]' => 'french 1', ); - $this->drupalPostForm(NULL, $edit, t('Save and keep published (this translation)')); + $this->drupalPostForm(NULL, $edit, t('Save (this translation)')); $this->assertText('Paragraphed article Title in french has been updated.'); // Check the english translation. @@ -176,7 +176,7 @@ class ParagraphsExperimentalTranslationTest extends ParagraphsExperimentalTestBa 'revision' => TRUE, 'revision_log[0][value]' => 'french 2', ); - $this->drupalPostForm(NULL, $edit, t('Save and keep published (this translation)')); + $this->drupalPostForm(NULL, $edit, t('Save (this translation)')); $this->assertText('Title Change in french'); $this->assertText('New text in french'); @@ -186,7 +186,7 @@ class ParagraphsExperimentalTranslationTest extends ParagraphsExperimentalTestBa $this->assertText('Title in english'); $this->assertText('Text in english'); // Save the original content on second request. - $this->drupalPostForm(NULL, NULL, t('Save and keep published (this translation)')); + $this->drupalPostForm(NULL, NULL, t('Save (this translation)')); $this->assertText('Paragraphed article Title in english has been updated.'); // Test if reverting to old paragraphs revisions works, make sure that @@ -197,7 +197,7 @@ class ParagraphsExperimentalTranslationTest extends ParagraphsExperimentalTestBa $this->clickLink(t('Edit')); $this->assertRaw('Title in french'); $this->assertText('Text in french'); - $this->drupalPostForm(NULL, [], t('Save and keep published (this translation)')); + $this->drupalPostForm(NULL, [], t('Save (this translation)')); $this->assertNoRaw('The content has either been modified by another user, or you have already submitted modifications'); $this->assertText('Text in french'); @@ -241,7 +241,7 @@ class ParagraphsExperimentalTranslationTest extends ParagraphsExperimentalTestBa 'field_paragraphs_demo[0][subform][field_images_demo][0][alt]' => 'Image alt FR', 'field_paragraphs_demo[0][subform][field_images_demo][0][title]' => 'Image title FR', ]; - $this->drupalPostForm(NULL, $edit, t('Save and keep published (this translation)')); + $this->drupalPostForm(NULL, $edit, t('Save (this translation)')); $this->assertRaw('Title FR'); $this->drupalGet('node/add/paragraphed_content_demo'); @@ -284,7 +284,7 @@ class ParagraphsExperimentalTranslationTest extends ParagraphsExperimentalTestBa 'field_paragraphs_demo' => [$paragraph_1, $translated_paragraph], ]); $this->drupalGet('node/' . $node->id() . '/edit'); - $this->drupalPostForm(NULL, [], t('Save and keep published')); + $this->drupalPostForm(NULL, [], t('Save')); $this->assertText('Paragraphed article ' . $node->label() . ' has been updated.'); // Check that first paragraph langcode has been updated. $paragraph = Paragraph::load($paragraph_1->id()); @@ -301,7 +301,7 @@ class ParagraphsExperimentalTranslationTest extends ParagraphsExperimentalTestBa 'field_paragraphs_demo[0][subform][field_text_demo][0][value]' => 'english_translation_1', 'field_paragraphs_demo[1][subform][field_text_demo][0][value]' => 'english_translation_2', ]; - $this->drupalPostForm('node/' . $node->id() . '/translations/add/de/en', $edit, t('Save and keep published (this translation)')); + $this->drupalPostForm('node/' . $node->id() . '/translations/add/de/en', $edit, t('Save (this translation)')); // Attempt to create a french translation. $this->drupalGet('node/' . $node->id() . '/translations/add/de/fr'); // Check that the german translation of the paragraphs is displayed. @@ -424,7 +424,7 @@ class ParagraphsExperimentalTranslationTest extends ParagraphsExperimentalTestBa $edit = [ 'title[0][value]' => 'Title in french', ]; - $this->drupalPostForm(NULL, $edit, t('Save and keep published (this translation)')); + $this->drupalPostForm(NULL, $edit, t('Save (this translation)')); $this->assertParagraphsLangcode($node->id(), 'en', 'fr'); $this->assertText('Paragraphed article Title in french has been updated.'); $this->assertText('Title in french'); @@ -442,7 +442,7 @@ class ParagraphsExperimentalTranslationTest extends ParagraphsExperimentalTestBa // check that the paragraphs buttons are still hidden. $this->assertParagraphsLangcode($node->id(), 'en', 'fr'); $this->assertNoParagraphsButtons(1); - $this->drupalPostForm(NULL, NULL, t('Save and keep published (this translation)')); + $this->drupalPostForm(NULL, NULL, t('Save (this translation)')); $this->assertText('Title in french'); $this->assertNoText('Title in english'); @@ -477,7 +477,7 @@ class ParagraphsExperimentalTranslationTest extends ParagraphsExperimentalTestBa ], t('Upload')); $this->assertParagraphsLangcode($node->id()); $this->assertParagraphsButtons(2); - $this->drupalPostForm(NULL, NULL, t('Save and keep published (this translation)')); + $this->drupalPostForm(NULL, NULL, t('Save (this translation)')); $this->assertText('Title in english (de)'); $this->assertNoText('Title in french'); // Check the original node and the paragraphs langcode are now 'de'. @@ -523,7 +523,7 @@ class ParagraphsExperimentalTranslationTest extends ParagraphsExperimentalTestBa // check that the paragraphs buttons are still hidden. $this->assertParagraphsLangcode($node->id(), 'de', 'fr'); $this->assertNoParagraphsButtons(2); - $this->drupalPostForm(NULL, NULL, t('Save and keep published (this translation)')); + $this->drupalPostForm(NULL, NULL, t('Save (this translation)')); // Check the paragraphs langcode are still 'de' after saving the translation. $this->assertParagraphsLangcode($node->id(), 'de', 'fr'); $this->assertText('Title in french'); @@ -555,7 +555,7 @@ class ParagraphsExperimentalTranslationTest extends ParagraphsExperimentalTestBa ], t('Upload')); $this->assertParagraphsLangcode($node->id(), 'de'); $this->assertParagraphsButtons(3); - $this->drupalPostForm(NULL, NULL, t('Save and keep published (this translation)')); + $this->drupalPostForm(NULL, NULL, t('Save (this translation)')); // Check the original node and the paragraphs langcode are now 'en'. $this->assertParagraphsLangcode($node->id()); } @@ -624,7 +624,7 @@ class ParagraphsExperimentalTranslationTest extends ParagraphsExperimentalTestBa // Check the paragraph langcode is still 'de' and its buttons are shown. $this->assertParagraphsLangcode($node1->id(), 'de'); $this->assertParagraphsButtons(1); - $this->drupalPostForm(NULL, NULL, t('Save and keep published')); + $this->drupalPostForm(NULL, NULL, t('Save')); // Check the paragraph langcode is now 'en' after saving. $this->assertParagraphsLangcode($node1->id()); @@ -680,7 +680,7 @@ class ParagraphsExperimentalTranslationTest extends ParagraphsExperimentalTestBa ], t('Upload')); $this->assertParagraphsLangcode($node2->id()); $this->assertParagraphsButtons(2); - $this->drupalPostForm(NULL, NULL, t('Save and keep published')); + $this->drupalPostForm(NULL, NULL, t('Save')); // Check the paragraphs langcode are now 'de' after saving. $this->assertParagraphsLangcode($node2->id(), 'de'); @@ -690,7 +690,7 @@ class ParagraphsExperimentalTranslationTest extends ParagraphsExperimentalTestBa 'title[0][value]' => 'Title in english', 'langcode[0][value]' => 'en', ]; - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Save')); // Check the paragraphs langcode are now 'en' after saving. $this->assertParagraphsLangcode($node2->id()); @@ -720,7 +720,7 @@ class ParagraphsExperimentalTranslationTest extends ParagraphsExperimentalTestBa ], t('Upload')); $this->assertParagraphsLangcode($node2->id()); $this->assertParagraphsButtons(3); - $this->drupalPostForm(NULL, NULL, t('Save and keep published')); + $this->drupalPostForm(NULL, NULL, t('Save')); // Check the paragraphs langcode are still 'en' after saving. $this->assertParagraphsLangcode($node2->id()); @@ -745,7 +745,7 @@ class ParagraphsExperimentalTranslationTest extends ParagraphsExperimentalTestBa ], t('Upload')); $this->assertParagraphsLangcode($node2->id()); $this->assertParagraphsButtons(4); - $this->drupalPostForm(NULL, NULL, t('Save and keep published')); + $this->drupalPostForm(NULL, NULL, t('Save')); // Check the paragraphs langcode are now 'de' after saving. $this->assertParagraphsLangcode($node2->id(), 'de'); } diff --git a/src/Tests/Experimental/ParagraphsExperimentalWidgetButtonsTest.php b/src/Tests/Experimental/ParagraphsExperimentalWidgetButtonsTest.php index dd5f95c..2076ab5 100644 --- a/src/Tests/Experimental/ParagraphsExperimentalWidgetButtonsTest.php +++ b/src/Tests/Experimental/ParagraphsExperimentalWidgetButtonsTest.php @@ -55,7 +55,7 @@ class ParagraphsExperimentalWidgetButtonsTest extends ParagraphsExperimentalTest // Test the 'Open' mode. $this->drupalGet('node/' . $node->id() . '/edit'); $this->assertFieldByName('field_paragraphs[0][subform][field_text][0][value]', $text); - $this->drupalPostForm(NULL, [], t('Save and keep published')); + $this->drupalPostForm(NULL, [], t('Save')); $this->assertText($text); // Test the 'Closed' mode. @@ -74,7 +74,7 @@ class ParagraphsExperimentalWidgetButtonsTest extends ParagraphsExperimentalTest // Verify that we have warning message for each paragraph. $this->assertNoUniqueText('You have unsaved changes on this Paragraph item.'); $this->assertRaw('
' . $closed_mode_text); - $this->drupalPostForm(NULL, [], t('Save and keep published')); + $this->drupalPostForm(NULL, [], t('Save')); $this->assertText('paragraphed_test ' . $node->label() . ' has been updated.'); $this->assertText($closed_mode_text); @@ -90,7 +90,7 @@ class ParagraphsExperimentalWidgetButtonsTest extends ParagraphsExperimentalTest $this->drupalPostAjaxForm(NULL, $edit, 'field_paragraphs_0_collapse'); $this->assertText('You have unsaved changes on this Paragraph item.'); $this->assertText($preview_mode_text); - $this->drupalPostForm(NULL, [], t('Save and keep published')); + $this->drupalPostForm(NULL, [], t('Save')); $this->assertText('paragraphed_test ' . $node->label() . ' has been updated.'); $this->assertText($preview_mode_text); @@ -98,7 +98,7 @@ class ParagraphsExperimentalWidgetButtonsTest extends ParagraphsExperimentalTest $this->drupalGet('node/' . $node->id() . '/edit'); // Click "Remove" button. $this->drupalPostAjaxForm(NULL, [], 'field_paragraphs_0_remove'); - $this->drupalPostForm(NULL, [], t('Save and keep published')); + $this->drupalPostForm(NULL, [], t('Save')); $this->assertText('paragraphed_test ' . $node->label() . ' has been updated.'); $this->assertNoText($preview_mode_text); }