function InstallerExistingDatabaseSettingsTest::setUpSettings

Same name in other branches
  1. 9 core/tests/Drupal/FunctionalTests/Installer/InstallerExistingDatabaseSettingsTest.php \Drupal\FunctionalTests\Installer\InstallerExistingDatabaseSettingsTest::setUpSettings()
  2. 8.9.x core/tests/Drupal/FunctionalTests/Installer/InstallerExistingDatabaseSettingsTest.php \Drupal\FunctionalTests\Installer\InstallerExistingDatabaseSettingsTest::setUpSettings()
  3. 11.x core/tests/Drupal/FunctionalTests/Installer/InstallerExistingDatabaseSettingsTest.php \Drupal\FunctionalTests\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/tests/Drupal/FunctionalTests/Installer/InstallerExistingDatabaseSettingsTest.php, line 44

Class

InstallerExistingDatabaseSettingsTest
Tests installation with database information in an existing settings file.

Namespace

Drupal\FunctionalTests\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 = [];
    if (isset($values[$driver]['password']) && $values[$driver]['password'] !== '') {
        $edit = $this->translatePostValues([
            $driver => [
                'password' => $values[$driver]['password'],
            ],
        ]);
    }
    $this->submitForm($edit, $this->translations['Save and continue']);
}

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