You are here

protected function TermTranslationFieldViewTest::setUpTerm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/taxonomy/src/Tests/TermTranslationFieldViewTest.php \Drupal\taxonomy\Tests\TermTranslationFieldViewTest::setUpTerm()

Creates a test subject term, with translation.

1 call to TermTranslationFieldViewTest::setUpTerm()
TermTranslationFieldViewTest::setUp in core/modules/taxonomy/src/Tests/TermTranslationFieldViewTest.php
Sets up a Drupal site for running functional and integration tests.

File

core/modules/taxonomy/src/Tests/TermTranslationFieldViewTest.php, line 96
Contains \Drupal\taxonomy\Tests\TermTranslationFieldViewTest.

Class

TermTranslationFieldViewTest
Tests the translation of taxonomy terms field on nodes.

Namespace

Drupal\taxonomy\Tests

Code

protected function setUpTerm() {
  $this->term = $this
    ->createTerm($this->vocabulary, array(
    'name' => $this->baseTagName,
    'langcode' => $this->baseLangcode,
  ));
  $this->term
    ->addTranslation($this->translateToLangcode, array(
    'name' => $this->translatedTagName,
  ));
  $this->term
    ->save();
}