You are here

protected function InstallerTranslationTest::setUpSettings in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Installer/InstallerTranslationTest.php \Drupal\system\Tests\Installer\InstallerTranslationTest::setUpSettings()

inheritdoc}

Overrides InstallerTestBase::setUpSettings

File

core/modules/system/src/Tests/Installer/InstallerTranslationTest.php, line 52
Contains \Drupal\system\Tests\Installer\InstallerTranslationTest.

Class

InstallerTranslationTest
Installs Drupal in German and checks resulting site.

Namespace

Drupal\system\Tests\Installer

Code

protected function setUpSettings() {

  // We are creating a table here to force an error in the installer because
  // it will try and create the drupal_install_test table as this is part of
  // the standard database tests performed by the installer in
  // Drupal\Core\Database\Install\Tasks.
  Database::getConnection('default')
    ->query('CREATE TABLE {drupal_install_test} (id int NULL)');
  parent::setUpSettings();

  // Ensure that the error message translation is working.
  $this
    ->assertRaw('Beheben Sie alle Probleme unten, um die Installation fortzusetzen. Informationen zur Konfiguration der Datenbankserver finden Sie in der <a href="https://www.drupal.org/getting-started/install">Installationshandbuch</a>, oder kontaktieren Sie Ihren Hosting-Anbieter.');
  $this
    ->assertRaw('<strong>CREATE</strong> ein Test-Tabelle auf Ihrem Datenbankserver mit dem Befehl <em class="placeholder">CREATE TABLE {drupal_install_test} (id int NULL)</em> fehlgeschlagen.');

  // Now do it successfully.
  Database::getConnection('default')
    ->query('DROP TABLE {drupal_install_test}');
  parent::setUpSettings();
}