getFormSubmitActionForNewTranslation example

    $langcode = 'it';
    $language = ConfigurableLanguage::load($langcode);
    $values[$langcode] = $this->getNewEntityValues($langcode);

    $entity_type_id = $entity->getEntityTypeId();
    $add_url = Url::fromRoute("entity.$entity_type_id.content_translation_add", [
      $entity->getEntityTypeId() => $entity->id(),
      'source' => $default_langcode,
      'target' => $langcode,
    ]['language' => $language]);
    $this->drupalGet($add_url);
    $this->submitForm($this->getEditValues($values$langcode)$this->getFormSubmitActionForNewTranslation($entity$langcode));

    // Assert that HTML is not escaped unexpectedly.     if ($this->testHTMLEscapeForAllLanguages) {
      $this->assertSession()->responseNotContains('<span class="translation-entity-all-languages">(all languages)</span>');
      $this->assertSession()->responseContains('<span class="translation-entity-all-languages">(all languages)</span>');
    }

    // Ensure that the content language cache context is not yet added to the     // page.     $storage = $this->container->get('entity_type.manager')
      ->getStorage($this->entityTypeId);
    
Home | Imprint | This part of the site doesn't use cookies.