You are here

function InstallerLanguageTest::testInstallerTranslationCache in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/system/src/Tests/Installer/InstallerLanguageTest.php \Drupal\system\Tests\Installer\InstallerLanguageTest::testInstallerTranslationCache()

Tests profile info caching in non-English languages.

File

core/modules/system/src/Tests/Installer/InstallerLanguageTest.php, line 48
Contains \Drupal\system\Tests\Installer\InstallerLanguageTest.

Class

InstallerLanguageTest
Tests for installer language support.

Namespace

Drupal\system\Tests\Installer

Code

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
    ->assertFalse(in_array('locale', $info_en['dependencies']), 'Locale is not set when installing in English.');
  $this
    ->assertTrue(in_array('locale', $info_nl['dependencies']), 'Locale is set when installing in Dutch.');
}