X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fnode%2Ftests%2Fsrc%2FFunctional%2FNodeTranslationUITest.php;h=a44bea131efef4af4c7444f55c4ea416bd70e1a1;hp=a8a74544ec66934520ff108f605adbd802ed6025;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/node/tests/src/Functional/NodeTranslationUITest.php b/web/core/modules/node/tests/src/Functional/NodeTranslationUITest.php index a8a74544e..a44bea131 100644 --- a/web/core/modules/node/tests/src/Functional/NodeTranslationUITest.php +++ b/web/core/modules/node/tests/src/Functional/NodeTranslationUITest.php @@ -99,7 +99,9 @@ class NodeTranslationUITest extends ContentTranslationUITestBase { 'source' => $default_langcode, 'target' => $langcode ], ['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)')); $storage->resetCache([$this->entityId]); $entity = $storage->load($this->entityId); @@ -136,18 +138,6 @@ class NodeTranslationUITest extends ContentTranslationUITestBase { return ['title' => [['value' => $this->randomMachineName()]]] + parent::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} */ @@ -158,18 +148,18 @@ class NodeTranslationUITest extends ContentTranslationUITestBase { $entity = $storage->load($this->entityId); $languages = $this->container->get('language_manager')->getLanguages(); - $actions = [ - t('Save and keep published'), - t('Save and unpublish'), + $statuses = [ + 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 = ['language' => $languages[$langcode]]; $url = $entity->urlInfo('edit-form', $options); - $this->drupalPostForm($url, [], $action . $this->getFormSubmitSuffix($entity, $langcode), $options); + $this->drupalPostForm($url, ['status[value]' => $value], t('Save') . $this->getFormSubmitSuffix($entity, $langcode), $options); } $storage->resetCache([$this->entityId]); $entity = $storage->load($this->entityId);