diff -u b/core/modules/file/src/Tests/FileFieldDisplayTest.php b/core/modules/file/src/Tests/FileFieldDisplayTest.php --- b/core/modules/file/src/Tests/FileFieldDisplayTest.php +++ b/core/modules/file/src/Tests/FileFieldDisplayTest.php @@ -75,7 +75,6 @@ // Turn the "display" option off and check that the file is no longer displayed. $edit = array( $field_name . '[0][display]' => FALSE, - 'status[value]' => TRUE, ); $this->drupalPostForm('node/' . $nid . '/edit', $edit, t('Save')); @@ -86,7 +85,6 @@ $edit = array( $field_name . '[0][description]' => $description, $field_name . '[0][display]' => TRUE, - 'status[value]' => TRUE, ); $this->drupalPostForm('node/' . $nid . '/edit', $edit, t('Save')); $this->assertText($description); diff -u b/core/modules/file/src/Tests/FileFieldRevisionTest.php b/core/modules/file/src/Tests/FileFieldRevisionTest.php --- b/core/modules/file/src/Tests/FileFieldRevisionTest.php +++ b/core/modules/file/src/Tests/FileFieldRevisionTest.php @@ -70,7 +70,6 @@ // Check that the file is still the same as the previous revision. $edit = array( 'revision' => TRUE, - 'status[value]' => TRUE, ); $this->drupalPostForm('node/' . $nid . '/edit', $edit, t('Save')); $node_storage->resetCache(array($nid)); diff -u b/core/modules/file/src/Tests/FileFieldTestBase.php b/core/modules/file/src/Tests/FileFieldTestBase.php --- b/core/modules/file/src/Tests/FileFieldTestBase.php +++ b/core/modules/file/src/Tests/FileFieldTestBase.php @@ -189,7 +189,6 @@ $edit = array( 'title[0][value]' => $this->randomMachineName(), 'revision' => (string) (int) $new_revision, - 'status[value]' => TRUE, ); $node_storage = $this->container->get('entity.manager')->getStorage('node'); @@ -241,7 +240,6 @@ function removeNodeFile($nid, $new_revision = TRUE) { $edit = array( 'revision' => (string) (int) $new_revision, - 'status[value]' => TRUE, ); $this->drupalPostForm('node/' . $nid . '/edit', array(), t('Remove')); @@ -255,7 +253,6 @@ $edit = array( 'files[' . $field_name . '_0]' => drupal_realpath($file->getFileUri()), 'revision' => (string) (int) $new_revision, - 'status[value]' => TRUE, ); $this->drupalPostForm('node/' . $nid . '/edit', array(), t('Remove')); diff -u b/core/modules/file/src/Tests/FileFieldWidgetTest.php b/core/modules/file/src/Tests/FileFieldWidgetTest.php --- b/core/modules/file/src/Tests/FileFieldWidgetTest.php +++ b/core/modules/file/src/Tests/FileFieldWidgetTest.php @@ -93,10 +93,7 @@ $this->assertTrue(isset($label[0]), 'Label for upload found.'); // Save the node and ensure it does not have the file. - $edit = array( - 'status[value]' => TRUE, - ); - $this->drupalPostForm(NULL, $edit, t('Save')); + $this->drupalPostForm(NULL, NULL, t('Save')); $node_storage->resetCache(array($nid)); $node = $node_storage->load($nid); $this->assertTrue(empty($node->{$field_name}->target_id), 'File was successfully removed from the node.'); diff -u b/core/modules/image/src/Tests/ImageFieldDisplayTest.php b/core/modules/image/src/Tests/ImageFieldDisplayTest.php --- b/core/modules/image/src/Tests/ImageFieldDisplayTest.php +++ b/core/modules/image/src/Tests/ImageFieldDisplayTest.php @@ -271,7 +271,6 @@ $edit = array( $field_name . '[0][alt]' => $image['#alt'], $field_name . '[0][title]' => $image['#title'], - 'status[value]' => TRUE, ); $this->drupalPostForm('node/' . $nid . '/edit', $edit, t('Save')); $default_output = str_replace("\n", NULL, $renderer->renderRoot($image)); @@ -282,7 +281,6 @@ $edit = array( $field_name . '[0][alt]' => $this->randomMachineName($test_size), $field_name . '[0][title]' => $this->randomMachineName($test_size), - 'status[value]' => TRUE, ); $this->drupalPostForm('node/' . $nid . '/edit', $edit, t('Save')); $schema = $field->getFieldStorageDefinition()->getSchema(); @@ -305,7 +303,6 @@ $this->drupalPostForm('admin/structure/types/manage/article/fields/node.article.' . $field_name . '/storage', array('cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED), t('Save field settings')); $edit = array( 'files[' . $field_name . '_1][]' => drupal_realpath($test_image->uri), - 'status[value]' => TRUE, ); $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save')); // Add the required alt text. diff -u b/core/modules/image/src/Tests/ImageFieldTestBase.php b/core/modules/image/src/Tests/ImageFieldTestBase.php --- b/core/modules/image/src/Tests/ImageFieldTestBase.php +++ b/core/modules/image/src/Tests/ImageFieldTestBase.php @@ -141,7 +141,11 @@ $this->drupalPostForm('node/add/' . $type, $edit, t('Save')); if ($alt) { // Add alt text. - $this->drupalPostForm(NULL, [$field_name . '[0][alt]' => $alt], t('Save')); + $edit = array( + $field_name . '[0][alt]' => $alt, + 'status[value]' => TRUE, + ); + $this->drupalPostForm(NULL, $edit, t('Save')); } // Retrieve ID of the newly created node from the current URL. diff -u b/core/modules/node/src/Tests/NodeEditFormTest.php b/core/modules/node/src/Tests/NodeEditFormTest.php --- b/core/modules/node/src/Tests/NodeEditFormTest.php +++ b/core/modules/node/src/Tests/NodeEditFormTest.php @@ -104,7 +104,6 @@ 'title[0][value]' => $this->randomMachineName(8), $body_key => $this->randomMachineName(16), 'revision' => TRUE, - 'status[value]' => TRUE, ); $this->drupalPostForm(NULL, $edit, t('Save')); @@ -163,10 +162,7 @@ $this->drupalLogin($this->adminUser); // Save the node without making any changes. - $edit = array( - 'status[value]' => TRUE, - ); - $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save')); + $this->drupalPostForm('node/' . $node->id() . '/edit', NULL, t('Save')); $this->nodeStorage->resetCache(array($node->id())); $node = $this->nodeStorage->load($node->id()); $this->assertIdentical($this->webUser->id(), $node->getOwner()->id()); @@ -178,10 +174,7 @@ // Check that saving the node without making any changes keeps the proper // author ID. - $edit = array( - 'status[value]' => TRUE, - ); - $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save')); + $this->drupalPostForm('node/' . $node->id() . '/edit', NULL, t('Save')); $this->nodeStorage->resetCache(array($node->id())); $node = $this->nodeStorage->load($node->id()); $this->assertIdentical($this->webUser->id(), $node->getOwner()->id()); @@ -199,7 +192,6 @@ // Try to change the 'authored by' field to an invalid user name. $edit = array( $form_element_name => 'invalid-name', - 'status[value]' => TRUE, ); $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save')); $this->assertRaw(t('There are no entities matching "%name".', array('%name' => 'invalid-name'))); @@ -208,7 +200,6 @@ // authorship to the anonymous user (uid 0). $edit = array( $form_element_name => '', - 'status[value]' => TRUE, ); $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save')); $this->nodeStorage->resetCache(array($node->id())); @@ -223,7 +214,6 @@ // logged in). $edit = array( $form_element_name => $this->webUser->getUsername(), - 'status[value]' => TRUE, ); $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save')); $this->nodeStorage->resetCache(array($node->id())); diff -u b/core/modules/node/src/Tests/NodeFormButtonsTest.php b/core/modules/node/src/Tests/NodeFormButtonsTest.php --- b/core/modules/node/src/Tests/NodeFormButtonsTest.php +++ b/core/modules/node/src/Tests/NodeFormButtonsTest.php @@ -49,9 +49,9 @@ // Verify the buttons on a node add form. $this->drupalGet('node/add/article'); - $this->assertButtons(array(t('Save and publish'), t('Save as unpublished'))); + $this->assertButtons(t('Save'), FALSE); - // Save the node and assert it's published after checking 'Published' + // Save the node and assert it's published after checking the 'Published' // boolean_checkbox and clicking 'Save'. $edit = array( 'title[0][value]' => $this->randomString(), @@ -65,7 +65,7 @@ // Verify the buttons on a node edit form. $this->drupalGet('node/' . $node_1->id() . '/edit'); - $this->assertButtons(array(t('Save and keep published'), t('Save and unpublish'))); + $this->assertButtons(t('Save'), FALSE); // Save the node and verify it's still published after clicking // 'Save'. @@ -74,7 +74,7 @@ $node_1 = $node_storage->load(1); $this->assertTrue($node_1->isPublished(), 'Node is published'); - // Save the node and verify it's unpublished after unchecking 'Published' + // Save the node and verify it's unpublished after unchecking the 'Published' // boolean_checkbox and clicking 'Save'. $edit = array( 'status[value]' => FALSE, @@ -86,7 +86,7 @@ // Verify the buttons on an unpublished node edit screen. $this->drupalGet('node/' . $node_1->id() . '/edit'); - $this->assertButtons(array(t('Save and keep unpublished'), t('Save and publish'))); + $this->assertButtons(t('Save'), FALSE); // Create a node as a normal user. $this->drupalLogout(); @@ -94,7 +94,7 @@ // Verify the buttons for a normal user. $this->drupalGet('node/add/article'); - $this->assertButtons(array(t('Save')), FALSE); + $this->assertButtons(t('Save'), FALSE); // Create the node. $edit = array('title[0][value]' => $this->randomString()); @@ -135,7 +135,7 @@ // Verify the buttons on a node add form for an administrator. $this->drupalLogin($this->adminUser); $this->drupalGet('node/add/article'); - $this->assertButtons(array(t('Save as unpublished'), t('Save and publish'))); + $this->assertButtons(t('Save'), FALSE); // Verify the node is unpublished by default for a normal user. $this->drupalLogout(); diff -u b/core/modules/node/src/Tests/NodeRevisionsUiTest.php b/core/modules/node/src/Tests/NodeRevisionsUiTest.php --- b/core/modules/node/src/Tests/NodeRevisionsUiTest.php +++ b/core/modules/node/src/Tests/NodeRevisionsUiTest.php @@ -61,7 +61,6 @@ // Uncheck the create new revision checkbox and save the node. $edit = array( 'revision' => FALSE, - 'status[value]' => TRUE, ); $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save')); @@ -75,10 +74,7 @@ $this->assertFieldChecked('edit-revision', "'Create new revision' checkbox is checked"); // Submit the form without changing the checkbox. - $edit = array( - 'status[value]' => TRUE, - ); - $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save')); + $this->drupalPostForm('node/' . $node->id() . '/edit', NULL, t('Save')); // Load the node again and check the revision is different from before. $node_storage->resetCache(array($node->id())); diff -u b/core/modules/options/src/Tests/OptionsFieldUITest.php b/core/modules/options/src/Tests/OptionsFieldUITest.php --- b/core/modules/options/src/Tests/OptionsFieldUITest.php +++ b/core/modules/options/src/Tests/OptionsFieldUITest.php @@ -331,7 +331,6 @@ // Select a default value. $edit = array( $this->fieldName => TRUE, - 'status[value]' => TRUE, ); $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save')); diff -u b/core/modules/system/src/Tests/Menu/BreadcrumbTest.php b/core/modules/system/src/Tests/Menu/BreadcrumbTest.php --- b/core/modules/system/src/Tests/Menu/BreadcrumbTest.php +++ b/core/modules/system/src/Tests/Menu/BreadcrumbTest.php @@ -210,7 +210,6 @@ $edit = array( 'menu[menu_parent]' => $link->getMenuName() . ':' . $link->getPluginId(), - 'status[value]' => TRUE, ); $this->drupalPostForm('node/' . $parent->id() . '/edit', $edit, t('Save')); $expected = array( @@ -232,7 +231,6 @@ ); $edit = array( 'field_tags[target_id]' => implode(',', array_keys($tags)), - 'status[value]' => TRUE, ); $this->drupalPostForm('node/' . $parent->id() . '/edit', $edit, t('Save')); diff -u b/core/modules/system/src/Tests/Update/UpdatePathRC1TestBaseFilledTest.php b/core/modules/system/src/Tests/Update/UpdatePathRC1TestBaseFilledTest.php --- b/core/modules/system/src/Tests/Update/UpdatePathRC1TestBaseFilledTest.php +++ b/core/modules/system/src/Tests/Update/UpdatePathRC1TestBaseFilledTest.php @@ -122,10 +122,7 @@ $this->assertText('Test Article - New title'); $this->assertText('Test 1'); $this->assertRaw('0.01'); - $edit = array( - 'status[value]' => TRUE, - ); - $this->drupalPostForm('node/8/edit', $edit, 'Save (this translation)'); + $this->drupalPostForm('node/8/edit', NULL, 'Save (this translation)'); $this->assertResponse(200); $this->drupalGet('node/8/edit', ['language' => $spanish]); $this->assertText('Test title Spanish'); only in patch2: unchanged: --- a/core/modules/node/src/Tests/NodeTranslationUITest.php +++ b/core/modules/node/src/Tests/NodeTranslationUITest.php @@ -100,7 +100,9 @@ public function testPublishedStatusNoFields() { 'source' => $default_langcode, 'target' => $langcode ], array('language' => $language)); - $this->drupalPostForm($add_url, $this->getEditValues($values, $langcode), t('Save and unpublish (this translation)')); + $edit = $this->getEditValues($values, $langcode); + $edit['status[value]'] = FALSE; + $this->drupalPostForm($add_url, $edit, t('Save (this translation)')); $entity = entity_load($this->entityTypeId, $this->entityId, TRUE); $translation = $entity->getTranslation($langcode); @@ -139,34 +141,22 @@ protected function getNewEntityValues($langcode) { /** * {@inheritdoc} */ - protected function getFormSubmitAction(EntityInterface $entity, $langcode) { - if ($entity->getTranslation($langcode)->isPublished()) { - return t('Save and keep published') . $this->getFormSubmitSuffix($entity, $langcode); - } - else { - return t('Save and keep unpublished') . $this->getFormSubmitSuffix($entity, $langcode); - } - } - - /** - * {@inheritdoc} - */ protected function doTestPublishedStatus() { $entity = entity_load($this->entityTypeId, $this->entityId, TRUE); $languages = $this->container->get('language_manager')->getLanguages(); - $actions = array( - t('Save and keep published'), - t('Save and unpublish'), + $statuses = array( + TRUE, + FALSE, ); - foreach ($actions as $index => $action) { + foreach ($statuses as $index => $value) { // (Un)publish the node translations and check that the translation // statuses are (un)published accordingly. foreach ($this->langcodes as $langcode) { $options = array('language' => $languages[$langcode]); $url = $entity->urlInfo('edit-form', $options); - $this->drupalPostForm($url, array(), $action . $this->getFormSubmitSuffix($entity, $langcode), $options); + $this->drupalPostForm($url, ['status[value]' => $value], t('Save') . $this->getFormSubmitSuffix($entity, $langcode), $options); } $entity = entity_load($this->entityTypeId, $this->entityId, TRUE); foreach ($this->langcodes as $langcode) { only in patch2: unchanged: --- a/core/modules/system/src/Tests/Update/UpdatePathTestBaseFilledTest.php +++ b/core/modules/system/src/Tests/Update/UpdatePathTestBaseFilledTest.php @@ -122,7 +122,7 @@ public function testUpdatedSite() { $this->assertText('Test Article - New title'); $this->assertText('Test 1'); $this->assertRaw('0.01'); - $this->drupalPostForm('node/8/edit', [], 'Save and keep published (this translation)'); + $this->drupalPostForm('node/8/edit', [], 'Save (this translation)'); $this->assertResponse(200); $this->drupalGet('node/8/edit', ['language' => $spanish]); $this->assertText('Test title Spanish');