function MigrateEntityTranslationSettingsTest::testEntityTranslationSettingsMigration

Same name in other branches
  1. 9 core/modules/content_translation/tests/src/Kernel/Migrate/d7/MigrateEntityTranslationSettingsTest.php \Drupal\Tests\content_translation\Kernel\Migrate\d7\MigrateEntityTranslationSettingsTest::testEntityTranslationSettingsMigration()
  2. 8.9.x core/modules/content_translation/tests/src/Kernel/Migrate/d7/MigrateEntityTranslationSettingsTest.php \Drupal\Tests\content_translation\Kernel\Migrate\d7\MigrateEntityTranslationSettingsTest::testEntityTranslationSettingsMigration()
  3. 10 core/modules/content_translation/tests/src/Kernel/Migrate/d7/MigrateEntityTranslationSettingsTest.php \Drupal\Tests\content_translation\Kernel\Migrate\d7\MigrateEntityTranslationSettingsTest::testEntityTranslationSettingsMigration()

Tests entity translation settings migration.

File

core/modules/content_translation/tests/src/Kernel/Migrate/d7/MigrateEntityTranslationSettingsTest.php, line 62

Class

MigrateEntityTranslationSettingsTest
Tests the migration of entity translation settings.

Namespace

Drupal\Tests\content_translation\Kernel\Migrate\d7

Code

public function testEntityTranslationSettingsMigration() : void {
    // Tests 'comment_node_test_content_type' entity translation settings.
    $config = $this->config('language.content_settings.comment.comment_node_test_content_type');
    $this->assertSame($config->get('target_entity_type_id'), 'comment');
    $this->assertSame($config->get('target_bundle'), 'comment_node_test_content_type');
    $this->assertSame($config->get('default_langcode'), 'current_interface');
    $this->assertFalse((bool) $config->get('language_alterable'));
    $this->assertTrue((bool) $config->get('third_party_settings.content_translation.enabled'));
    $this->assertFalse((bool) $config->get('third_party_settings.content_translation.bundle_settings.untranslatable_fields_hide'));
    // Tests 'test_content_type' entity translation settings.
    $config = $this->config('language.content_settings.node.test_content_type');
    $this->assertSame($config->get('target_entity_type_id'), 'node');
    $this->assertSame($config->get('target_bundle'), 'test_content_type');
    $this->assertSame($config->get('default_langcode'), LanguageInterface::LANGCODE_NOT_SPECIFIED);
    $this->assertTrue((bool) $config->get('language_alterable'));
    $this->assertTrue((bool) $config->get('third_party_settings.content_translation.enabled'));
    $this->assertFalse((bool) $config->get('third_party_settings.content_translation.bundle_settings.untranslatable_fields_hide'));
    // Tests 'test_vocabulary' entity translation settings.
    $config = $this->config('language.content_settings.taxonomy_term.test_vocabulary');
    $this->assertSame($config->get('target_entity_type_id'), 'taxonomy_term');
    $this->assertSame($config->get('target_bundle'), 'test_vocabulary');
    $this->assertSame($config->get('default_langcode'), LanguageInterface::LANGCODE_SITE_DEFAULT);
    $this->assertFalse((bool) $config->get('language_alterable'));
    $this->assertTrue((bool) $config->get('third_party_settings.content_translation.enabled'));
    $this->assertFalse((bool) $config->get('third_party_settings.content_translation.bundle_settings.untranslatable_fields_hide'));
    // Tests 'user' entity translation settings.
    $config = $this->config('language.content_settings.user.user');
    $this->assertSame($config->get('target_entity_type_id'), 'user');
    $this->assertSame($config->get('target_bundle'), 'user');
    $this->assertSame($config->get('default_langcode'), LanguageInterface::LANGCODE_SITE_DEFAULT);
    $this->assertFalse((bool) $config->get('language_alterable'));
    $this->assertTrue((bool) $config->get('third_party_settings.content_translation.enabled'));
    $this->assertFalse((bool) $config->get('third_party_settings.content_translation.bundle_settings.untranslatable_fields_hide'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.