You are here

protected function InstallerLanguagePageTest::setUpLanguage in Zircon Profile 8.0

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

Installer step: Select language.

Overrides InstallerTestBase::setUpLanguage

File

core/modules/system/src/Tests/Installer/InstallerLanguagePageTest.php, line 23
Contains \Drupal\system\Tests\Installer\InstallerLanguagePageTest.

Class

InstallerLanguagePageTest
Verifies that the installer language list combines local and remote languages.

Namespace

Drupal\system\Tests\Installer

Code

protected function setUpLanguage() {

  // Place a custom local translation in the translations directory.
  mkdir(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE);
  touch(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.xoxo.po');

  // Check that all predefined languages show up with their native names.
  $this
    ->drupalGet($GLOBALS['base_url'] . '/core/install.php');
  foreach (LanguageManager::getStandardLanguageList() as $langcode => $names) {
    $this
      ->assertOption('edit-langcode', $langcode);
    $this
      ->assertRaw('>' . $names[1] . '<');
  }

  // Check that our custom one shows up with the file name indicated language.
  $this
    ->assertOption('edit-langcode', 'xoxo');
  $this
    ->assertRaw('>xoxo<');
  parent::setUpLanguage();
}