function TermTranslationFieldViewTest::setUpTerm
Creates a test subject term, with translation.
1 call to TermTranslationFieldViewTest::setUpTerm()
- TermTranslationFieldViewTest::setUp in core/modules/ taxonomy/ tests/ src/ Functional/ TermTranslationFieldViewTest.php 
File
- 
              core/modules/ taxonomy/ tests/ src/ Functional/ TermTranslationFieldViewTest.php, line 103 
Class
- TermTranslationFieldViewTest
- Tests the translation of taxonomy terms field on nodes.
Namespace
Drupal\Tests\taxonomy\FunctionalCode
protected function setUpTerm() {
  $this->term = $this->createTerm($this->vocabulary, [
    'name' => $this->baseTagName,
    'langcode' => $this->baseLangcode,
  ]);
  $this->term
    ->addTranslation($this->translateToLangcode, [
    'name' => $this->translatedTagName,
  ]);
  $this->term
    ->save();
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
