trait TaxonomyTranslationTestTrait (View source)

deprecated in drupal:8.4.0 and is removed from drupal:9.0.0. Use \Drupal\Tests\taxonomy\Functional\TaxonomyTranslationTestTrait

Provides common testing base for translated taxonomy terms.

Traits

EntityReferenceTestTrait

Properties

protected Vocabulary $vocabulary

The vocabulary.

protected string $termFieldName

The field name for our taxonomy term field.

protected string $baseLangcode

The langcode of the source language.

protected string $translateToLangcode

Target langcode for translation.

protected Node $node

The node to check the translated value on.

Methods

setupLanguages()

Adds additional languages.

enableTranslation()

Enables translations where it needed.

setUpTermReferenceField()

Adds term reference field for the article content type.

Details

protected setupLanguages()

Adds additional languages.

protected enableTranslation()

Enables translations where it needed.

protected setUpTermReferenceField()

Adds term reference field for the article content type.