function InstallerBrokenDatabasePortSettingsTest::prepareEnvironment
Same name in other branches
- 10 core/tests/Drupal/FunctionalTests/Installer/InstallerBrokenDatabasePortSettingsTest.php \Drupal\FunctionalTests\Installer\InstallerBrokenDatabasePortSettingsTest::prepareEnvironment()
Overrides FunctionalTestSetupTrait::prepareEnvironment
File
-
core/
tests/ Drupal/ FunctionalTests/ Installer/ InstallerBrokenDatabasePortSettingsTest.php, line 24
Class
- InstallerBrokenDatabasePortSettingsTest
- Tests the installer with incorrect connection info in settings.php.
Namespace
Drupal\FunctionalTests\InstallerCode
protected function prepareEnvironment() : void {
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');
}
// Override the port number to random port.
$connection_info['default']['port'] = 1234;
$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.