function InstallerExistingDatabaseSettingsTest::prepareEnvironment
Same name in other branches
- 8.9.x core/tests/Drupal/FunctionalTests/Installer/InstallerExistingDatabaseSettingsTest.php \Drupal\FunctionalTests\Installer\InstallerExistingDatabaseSettingsTest::prepareEnvironment()
- 10 core/tests/Drupal/FunctionalTests/Installer/InstallerExistingDatabaseSettingsTest.php \Drupal\FunctionalTests\Installer\InstallerExistingDatabaseSettingsTest::prepareEnvironment()
- 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\InstallerCode
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.