LanguageContentSettingsNodeTest.php in Commerce Migrate 3.1.x
File
modules/ubercart/tests/src/Kernel/Migrate/uc6/LanguageContentSettingsNodeTest.php
View source
<?php
namespace Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\uc6;
use Drupal\language\Entity\ContentLanguageSettings;
class LanguageContentSettingsNodeTest extends Ubercart6TestBase {
protected static $modules = [
'language',
];
protected function setUp() : void {
parent::setUp();
$this
->installConfig([
'node',
]);
$this
->executeMigrations([
'd6_node_type',
'language',
'd6_language_content_settings',
]);
}
public function testLanguageContent() {
$config = ContentLanguageSettings::loadByEntityTypeBundle('node', 'page');
$this
->assertTrue($config
->isDefaultConfiguration());
$this
->assertFalse($config
->isLanguageAlterable());
$this
->assertSame($config
->getDefaultLangcode(), 'site_default');
$config = ContentLanguageSettings::loadByEntityTypeBundle('node', 'story');
$this
->assertTrue($config
->isDefaultConfiguration());
$this
->assertFalse($config
->isLanguageAlterable());
$this
->assertSame($config
->getDefaultLangcode(), 'site_default');
$config = ContentLanguageSettings::loadByEntityTypeBundle('commerce_product', 'default');
$this
->assertTrue($config
->isDefaultConfiguration());
$this
->assertFalse($config
->isLanguageAlterable());
$this
->assertSame($config
->getDefaultLangcode(), 'site_default');
$config = ContentLanguageSettings::loadByEntityTypeBundle('commerce_product', 'product');
$this
->assertTrue($config
->isDefaultConfiguration());
$this
->assertFalse($config
->isLanguageAlterable());
$this
->assertSame($config
->getDefaultLangcode(), 'site_default');
$config = ContentLanguageSettings::loadByEntityTypeBundle('commerce_product', 'product_kit');
$this
->assertTrue($config
->isDefaultConfiguration());
$this
->assertFalse($config
->isLanguageAlterable());
$this
->assertSame($config
->getDefaultLangcode(), 'site_default');
$config = ContentLanguageSettings::loadByEntityTypeBundle('commerce_product', 'ship');
$this
->assertTrue($config
->isDefaultConfiguration());
$this
->assertFalse($config
->isLanguageAlterable());
$this
->assertSame($config
->getDefaultLangcode(), 'site_default');
}
}