MigrateLanguageContentSettingsTest.php in Drupal 9
File
core/modules/language/tests/src/Kernel/Migrate/d6/MigrateLanguageContentSettingsTest.php
View source
<?php
namespace Drupal\Tests\language\Kernel\Migrate\d6;
use Drupal\language\Entity\ContentLanguageSettings;
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
class MigrateLanguageContentSettingsTest extends MigrateDrupal6TestBase {
protected static $modules = [
'node',
'text',
'language',
'content_translation',
'menu_ui',
];
protected function setUp() : void {
parent::setUp();
$this
->installConfig([
'node',
]);
$this
->installEntitySchema('node');
$this
->executeMigrations([
'language',
'd6_node_type',
'd6_language_content_settings',
]);
}
public function testLanguageContent() {
$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'));
$config = ContentLanguageSettings::loadByEntityTypeBundle('node', 'company');
$this
->assertTrue($config
->isDefaultConfiguration());
$this
->assertFalse($config
->isLanguageAlterable());
$this
->assertSame($config
->getDefaultLangcode(), 'site_default');
$config = ContentLanguageSettings::loadByEntityTypeBundle('node', 'employee');
$this
->assertSame($config
->getDefaultLangcode(), 'current_interface');
$this
->assertTrue($config
->isLanguageAlterable());
}
}