You are here

protected function ContentTranslationUITestBase::getFormSubmitActionForNewTranslation in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php \Drupal\Tests\content_translation\Functional\ContentTranslationUITestBase::getFormSubmitActionForNewTranslation()
  2. 9 core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php \Drupal\Tests\content_translation\Functional\ContentTranslationUITestBase::getFormSubmitActionForNewTranslation()

Returns the form action value when submitting a new translation.

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.

File

core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php, line 430

Class

ContentTranslationUITestBase
Tests the Content Translation UI.

Namespace

Drupal\Tests\content_translation\Functional

Code

protected function getFormSubmitActionForNewTranslation(EntityInterface $entity, $langcode) {
  $entity
    ->addTranslation($langcode, $entity
    ->toArray());
  return $this
    ->getFormSubmitAction($entity, $langcode);
}