You are here

public function MigrateLanguageContentSettingsTest::testLanguageContent in Drupal 10

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

Tests migration of content language settings.

File

core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentSettingsTest.php, line 45

Class

MigrateLanguageContentSettingsTest
Tests migration of language content setting variables, language_content_type_$type, i18n_node_options_* and i18n_lock_node_*.

Namespace

Drupal\Tests\language\Kernel\Migrate\d6

Code

public function testLanguageContent() {

  // Assert that a translatable content is still translatable.
  $config = $this
    ->config('language.content_settings.node.article');
  $this
    ->assertSame($config
    ->get('target_entity_type_id'), 'node');
  $this
    ->assertSame($config
    ->get('target_bundle'), 'article');
  $this
    ->assertSame($config
    ->get('default_langcode'), 'current_interface');
  $this
    ->assertTrue($config
    ->get('third_party_settings.content_translation.enabled'));

  // Assert that a non-translatable content is not translatable.
  $config = ContentLanguageSettings::loadByEntityTypeBundle('node', 'company');
  $this
    ->assertTrue($config
    ->isDefaultConfiguration());
  $this
    ->assertFalse($config
    ->isLanguageAlterable());
  $this
    ->assertSame($config
    ->getDefaultLangcode(), 'site_default');

  // Assert that a we can assign a language when there is no language lock.
  $config = ContentLanguageSettings::loadByEntityTypeBundle('node', 'employee');
  $this
    ->assertSame($config
    ->getDefaultLangcode(), 'current_interface');
  $this
    ->assertTrue($config
    ->isLanguageAlterable());
}