Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Remove functional test database configuration fallback #538

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions Classes/Core/Testbase.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,9 @@ public function providePathsInTestInstance(string $instancePath, array $pathsToP

/**
* Database settings for functional and acceptance tests can be either set by
* environment variables (recommended), or from an existing LocalConfiguration as fallback.
* The method fetches these.
* environment variables (recommended). The method fetches these.
*
* An unique name will be added to the database name later.
* A unique name will be added to the database name later.
*
* @param array $config Incoming config arguments, used especially in acceptance test setups
* @throws Exception
Expand Down Expand Up @@ -482,9 +481,6 @@ public function getOriginalDatabaseSettingsFromEnvironmentOrLocalConfiguration(a
if ($databaseCharset) {
$originalConfigurationArray['DB']['Connections']['Default']['charset'] = $databaseCharset;
}
} elseif (file_exists(ORIGINAL_ROOT . 'typo3conf/LocalConfiguration.php')) {
// See if a LocalConfiguration file exists in "parent" instance to get db credentials from
$originalConfigurationArray = require ORIGINAL_ROOT . 'typo3conf/LocalConfiguration.php';
} else {
throw new Exception(
'Database credentials for tests are neither set through environment'
Expand All @@ -496,7 +492,7 @@ public function getOriginalDatabaseSettingsFromEnvironmentOrLocalConfiguration(a
// Instead of letting code run and retrieving mysterious result and errors, check for dropped sql driver
// support and throw a corresponding exception with a proper message.
// @todo Remove this in core v13 compatible testing-framework.
if (in_array($originalConfigurationArray['DB']['Connections']['Default']['driver'] ?? '', ['sqlsrv', 'pdo_sqlsrv'], true)) {
if (in_array($originalConfigurationArray['DB']['Connections']['Default']['driver'], ['sqlsrv', 'pdo_sqlsrv'], true)) {
throw new \RuntimeException(
'Microsoft SQL Server support has been dropped for TYPO3 v12 and testing-framework.'
. ' Therefore driver "' . $databaseDriver . '" is invalid.',
Expand Down
Loading