function InstallerLanguageTest::testInstallerTranslationCache

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Installer/InstallerLanguageTest.php \Drupal\KernelTests\Core\Installer\InstallerLanguageTest::testInstallerTranslationCache()
  2. 10 core/tests/Drupal/KernelTests/Core/Installer/InstallerLanguageTest.php \Drupal\KernelTests\Core\Installer\InstallerLanguageTest::testInstallerTranslationCache()
  3. 11.x core/tests/Drupal/KernelTests/Core/Installer/InstallerLanguageTest.php \Drupal\KernelTests\Core\Installer\InstallerLanguageTest::testInstallerTranslationCache()

Tests profile info caching in non-English languages.

File

core/tests/Drupal/KernelTests/Core/Installer/InstallerLanguageTest.php, line 45

Class

InstallerLanguageTest
Tests for installer language support.

Namespace

Drupal\KernelTests\Core\Installer

Code

public function testInstallerTranslationCache() {
    require_once 'core/includes/install.inc';
    // Prime the drupal_get_filename() static cache with the location of the
    // testing profile as it is not the currently active profile and we don't
    // yet have any cached way to retrieve its location.
    // @todo Remove as part of https://www.drupal.org/node/2186491
    drupal_get_filename('profile', 'testing', 'core/profiles/testing/testing.info.yml');
    $info_en = install_profile_info('testing', 'en');
    $info_nl = install_profile_info('testing', 'nl');
    $this->assertNotContains('locale', $info_en['install'], 'Locale is not set when installing in English.');
    $this->assertContains('locale', $info_nl['install'], 'Locale is set when installing in Dutch.');
}

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