function InstallerBrokenDatabaseCredentialsTest::prepareEnvironment
Same name in other branches
- 11.x core/tests/Drupal/FunctionalTests/Installer/InstallerBrokenDatabaseCredentialsTest.php \Drupal\FunctionalTests\Installer\InstallerBrokenDatabaseCredentialsTest::prepareEnvironment()
Overrides FunctionalTestSetupTrait::prepareEnvironment
File
-
core/
tests/ Drupal/ FunctionalTests/ Installer/ InstallerBrokenDatabaseCredentialsTest.php, line 24
Class
- InstallerBrokenDatabaseCredentialsTest
- Tests the installer with incorrect connection info in settings.php.
Namespace
Drupal\FunctionalTests\InstallerCode
protected function prepareEnvironment() {
parent::prepareEnvironment();
// Pre-configure database credentials in settings.php.
$connection_info = Database::getConnectionInfo();
if ($connection_info['default']['driver'] !== 'mysql') {
$this->markTestSkipped('This test relies on overriding the mysql driver');
}
// Provide incorrect host name and test the new error messages.
$connection_info['default']['host'] = 'localhost';
$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.