You are here

public function MigrateLanguageContentTaxonomyVocabularySettingsTest::testLanguageContentTaxonomy in Drupal 9

Same name in this branch
  1. 9 core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentTaxonomyVocabularySettingsTest.php \Drupal\Tests\language\Kernel\Migrate\d6\MigrateLanguageContentTaxonomyVocabularySettingsTest::testLanguageContentTaxonomy()
  2. 9 core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentTaxonomyVocabularySettingsTest.php \Drupal\Tests\language\Kernel\Migrate\d7\MigrateLanguageContentTaxonomyVocabularySettingsTest::testLanguageContentTaxonomy()
Same name and namespace in other branches
  1. 8 core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentTaxonomyVocabularySettingsTest.php \Drupal\Tests\language\Kernel\Migrate\d7\MigrateLanguageContentTaxonomyVocabularySettingsTest::testLanguageContentTaxonomy()

Tests migration of 18ntaxonomy vocabulary settings.

File

core/modules/language/tests/src/Kernel/Migrate/d7/MigrateLanguageContentTaxonomyVocabularySettingsTest.php, line 42

Class

MigrateLanguageContentTaxonomyVocabularySettingsTest
Tests migration of i18ntaxonomy vocabulary settings.

Namespace

Drupal\Tests\language\Kernel\Migrate\d7

Code

public function testLanguageContentTaxonomy() {
  $target_entity = 'taxonomy_term';

  // No multilingual options for terms, i18n_mode = 0.
  $this
    ->assertLanguageContentSettings($target_entity, 'tags', LanguageInterface::LANGCODE_NOT_SPECIFIED, FALSE, [
    'enabled' => FALSE,
  ]);
  $this
    ->assertLanguageContentSettings($target_entity, 'forums', LanguageInterface::LANGCODE_NOT_SPECIFIED, FALSE, [
    'enabled' => FALSE,
  ]);
  $this
    ->assertLanguageContentSettings($target_entity, 'vocabulary_name_much_longer_th', LanguageInterface::LANGCODE_NOT_SPECIFIED, FALSE, [
    'enabled' => FALSE,
  ]);
  $this
    ->assertLanguageContentSettings($target_entity, 'test_vocabulary', LanguageInterface::LANGCODE_NOT_SPECIFIED, FALSE, [
    'enabled' => FALSE,
  ]);

  // Localize, i18n_mode = 1.
  $this
    ->assertLanguageContentSettings($target_entity, 'vocablocalized', LanguageInterface::LANGCODE_NOT_SPECIFIED, TRUE, [
    'enabled' => TRUE,
  ]);

  // Translate, i18n_mode = 4.
  $this
    ->assertLanguageContentSettings($target_entity, 'vocabtranslate', LanguageInterface::LANGCODE_NOT_SPECIFIED, TRUE, [
    'enabled' => FALSE,
  ]);

  // Fixed language, i18n_mode = 2.
  $this
    ->assertLanguageContentSettings($target_entity, 'vocabfixed', 'fr', FALSE, [
    'enabled' => FALSE,
  ]);
}