You are here

protected function NodeTranslationUITest::getFormSubmitAction in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/node/src/Tests/NodeTranslationUITest.php \Drupal\node\Tests\NodeTranslationUITest::getFormSubmitAction()

Returns the form action value to be used to submit the entity form.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity being tested.

string $langcode: Language code for the form.

Return value

string Name of the button to hit.

Overrides ContentTranslationUITestBase::getFormSubmitAction

1 call to NodeTranslationUITest::getFormSubmitAction()
NodeTranslationUITest::doTestAuthoringInfo in core/modules/node/src/Tests/NodeTranslationUITest.php
Tests the translation authoring information.

File

core/modules/node/src/Tests/NodeTranslationUITest.php, line 142
Contains \Drupal\node\Tests\NodeTranslationUITest.

Class

NodeTranslationUITest
Tests the Node Translation UI.

Namespace

Drupal\node\Tests

Code

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);
  }
}