function MigrateSystemSiteTranslationTest::testSystemSite

Same name in this branch
  1. 9 core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateSystemSiteTranslationTest.php \Drupal\Tests\config_translation\Kernel\Migrate\d6\MigrateSystemSiteTranslationTest::testSystemSite()
Same name in other branches
  1. 8.9.x core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateSystemSiteTranslationTest.php \Drupal\Tests\config_translation\Kernel\Migrate\d6\MigrateSystemSiteTranslationTest::testSystemSite()
  2. 8.9.x core/modules/config_translation/tests/src/Kernel/Migrate/d7/MigrateSystemSiteTranslationTest.php \Drupal\Tests\config_translation\Kernel\Migrate\d7\MigrateSystemSiteTranslationTest::testSystemSite()
  3. 10 core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateSystemSiteTranslationTest.php \Drupal\Tests\config_translation\Kernel\Migrate\d6\MigrateSystemSiteTranslationTest::testSystemSite()
  4. 10 core/modules/config_translation/tests/src/Kernel/Migrate/d7/MigrateSystemSiteTranslationTest.php \Drupal\Tests\config_translation\Kernel\Migrate\d7\MigrateSystemSiteTranslationTest::testSystemSite()
  5. 11.x core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateSystemSiteTranslationTest.php \Drupal\Tests\config_translation\Kernel\Migrate\d6\MigrateSystemSiteTranslationTest::testSystemSite()
  6. 11.x core/modules/config_translation/tests/src/Kernel/Migrate/d7/MigrateSystemSiteTranslationTest.php \Drupal\Tests\config_translation\Kernel\Migrate\d7\MigrateSystemSiteTranslationTest::testSystemSite()

Tests migration of system (site) variables to system.site.yml.

File

core/modules/config_translation/tests/src/Kernel/Migrate/d7/MigrateSystemSiteTranslationTest.php, line 37

Class

MigrateSystemSiteTranslationTest
Migrate multilingual site variables.

Namespace

Drupal\Tests\config_translation\Kernel\Migrate\d7

Code

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'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.