MigrateSystemSiteTranslationTest.php in Drupal 10
File
core/modules/config_translation/tests/src/Kernel/Migrate/d7/MigrateSystemSiteTranslationTest.php
View source
<?php
namespace Drupal\Tests\config_translation\Kernel\Migrate\d7;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
class MigrateSystemSiteTranslationTest extends MigrateDrupal7TestBase {
protected static $modules = [
'language',
'config_translation',
];
protected function setUp() : void {
parent::setUp();
$this
->executeMigrations([
'language',
'system_site',
'd7_system_site_translation',
]);
}
public function testSystemSite() {
$language_manager = \Drupal::service('language_manager');
$config_translation = $language_manager
->getLanguageConfigOverride('fr', 'system.site');
$this
->assertSame('The Site Name', $config_translation
->get('name'));
$this
->assertSame('fr - The Slogan', $config_translation
->get('slogan'));
$this
->assertSame(NULL, $config_translation
->get('page.403'));
$this
->assertSame(NULL, $config_translation
->get('page.404'));
$this
->assertSame(NULL, $config_translation
->get('page.front'));
$this
->assertSame(NULL, $config_translation
->get('admin_compact_mode'));
$config_translation = $language_manager
->getLanguageConfigOverride('is', 'system.site');
$this
->assertSame('is - The Site Name', $config_translation
->get('name'));
$this
->assertSame('is - The Slogan', $config_translation
->get('slogan'));
$this
->assertSame(NULL, $config_translation
->get('page.403'));
$this
->assertSame(NULL, $config_translation
->get('page.404'));
$this
->assertSame(NULL, $config_translation
->get('page.front'));
$this
->assertNULL($config_translation
->get('admin_compact_mode'));
}
}