function InstallerExistingDatabaseSettingsTest::prepareEnvironment

Same name in other branches
  1. 8.9.x core/tests/Drupal/FunctionalTests/Installer/InstallerExistingDatabaseSettingsTest.php \Drupal\FunctionalTests\Installer\InstallerExistingDatabaseSettingsTest::prepareEnvironment()
  2. 10 core/tests/Drupal/FunctionalTests/Installer/InstallerExistingDatabaseSettingsTest.php \Drupal\FunctionalTests\Installer\InstallerExistingDatabaseSettingsTest::prepareEnvironment()
  3. 11.x core/tests/Drupal/FunctionalTests/Installer/InstallerExistingDatabaseSettingsTest.php \Drupal\FunctionalTests\Installer\InstallerExistingDatabaseSettingsTest::prepareEnvironment()

Overrides FunctionalTestSetupTrait::prepareEnvironment

File

core/tests/Drupal/FunctionalTests/Installer/InstallerExistingDatabaseSettingsTest.php, line 22

Class

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

Namespace

Drupal\FunctionalTests\Installer

Code

protected function prepareEnvironment() {
    parent::prepareEnvironment();
    // Pre-configure database credentials in settings.php.
    $connection_info = Database::getConnectionInfo();
    unset($connection_info['default']['pdo']);
    unset($connection_info['default']['init_commands']);
    $this->settings['databases']['default'] = (object) [
        'value' => $connection_info,
        'required' => TRUE,
    ];
}

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