You are here

protected function InstallerExistingDatabaseSettingsTest::setUpSettings in Zircon Profile 8

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

@todo The database settings form is not supposed to appear if settings.php contains a valid database connection already (but e.g. no config directories yet).

Overrides InstallerTestBase::setUpSettings

File

core/modules/system/src/Tests/Installer/InstallerExistingDatabaseSettingsTest.php, line 44
Contains \Drupal\system\Tests\Installer\InstallerExistingDatabaseSettingsTest.

Class

InstallerExistingDatabaseSettingsTest
Tests the installer with an existing settings file with database connection info.

Namespace

Drupal\system\Tests\Installer

Code

protected function setUpSettings() {

  // All database settings should be pre-configured, except password.
  $values = $this->parameters['forms']['install_settings_form'];
  $driver = $values['driver'];
  $edit = array();
  if (isset($values[$driver]['password']) && $values[$driver]['password'] !== '') {
    $edit = $this
      ->translatePostValues(array(
      $driver => array(
        'password' => $values[$driver]['password'],
      ),
    ));
  }
  $this
    ->drupalPostForm(NULL, $edit, $this->translations['Save and continue']);
}