function InstallerTranslationMultipleLanguageTest::verifyConfigLanguageAssumptions

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageTest.php \Drupal\FunctionalTests\Installer\InstallerTranslationMultipleLanguageTest::verifyConfigLanguageAssumptions()

Verifies config entity and simple config langcode assumptions.

File

core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageTest.php, line 195

Class

InstallerTranslationMultipleLanguageTest
Tests translation files for multiple languages get imported during install.

Namespace

Drupal\FunctionalTests\Installer

Code

protected function verifyConfigLanguageAssumptions() : void {
  if ($this->langcode === 'en') {
    return;
  }
  $config_factory = \Drupal::configFactory();
  foreach ([
    'language.entity.de',
    'language.entity.es',
  ] as $config_name) {
    $this->assertEquals($this->langcode, $config_factory->get($config_name)
      ->get('langcode'), "Config entity '{$config_name}' should use the installation language langcode.");
  }
  $this->assertNull($config_factory->get('system.performance')
    ->get('langcode'), 'Non-entity config without translatable data should not be rewritten to the installation language.');
}

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