LanguageContentSettingsNodeTest.php in Commerce Migrate 3.0.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 {
public static $modules = [
'language',
];
protected function setUp() {
parent::setUp();
$this
->installConfig([
'node',
]);
$this
->executeMigrations([
'd6_node_type',
'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');
}
}