Skip to content

Commit fef0bd6

Browse files
thomashohnsbuerk
authored andcommitted
[TASK] Use non deprecated database connection options (tableoptions, collate)
1 parent ff70168 commit fef0bd6

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Classes/Core/Acceptance/Extension/BackendEnvironment.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Codeception\Events;
2222
use Codeception\Extension;
2323
use TYPO3\CMS\Core\Database\ConnectionPool;
24+
use TYPO3\CMS\Core\Information\Typo3Version;
2425
use TYPO3\CMS\Core\Utility\GeneralUtility;
2526
use TYPO3\TestingFramework\Core\Functional\Framework\DataHandling\DataSet;
2627
use TYPO3\TestingFramework\Core\Testbase;
@@ -261,8 +262,15 @@ public function bootstrapTypo3Environment(SuiteEvent $suiteEvent)
261262
$testbase->testDatabaseNameIsNotTooLong($originalDatabaseName, $localConfiguration);
262263
if ($dbDriver === 'mysqli' || $dbDriver === 'pdo_mysql') {
263264
$localConfiguration['DB']['Connections']['Default']['charset'] = 'utf8mb4';
264-
$localConfiguration['DB']['Connections']['Default']['tableoptions']['charset'] = 'utf8mb4';
265-
$localConfiguration['DB']['Connections']['Default']['tableoptions']['collate'] = 'utf8mb4_unicode_ci';
265+
if ((new Typo3Version())->getMajorVersion() >= 12) {
266+
// @todo Use this as default when TYPO3 v11 support is dropped.
267+
$localConfiguration['DB']['Connections']['Default']['defaultTableOptions']['charset'] = 'utf8mb4';
268+
$localConfiguration['DB']['Connections']['Default']['defaultTableOptions']['collation'] = 'utf8mb4_unicode_ci';
269+
} else {
270+
// @todo Remove this when TYPO3 v11 support is dropped.
271+
$localConfiguration['DB']['Connections']['Default']['tableoptions']['charset'] = 'utf8mb4';
272+
$localConfiguration['DB']['Connections']['Default']['tableoptions']['collate'] = 'utf8mb4_unicode_ci';
273+
}
266274
}
267275
} else {
268276
// sqlite dbs of all tests are stored in a dir parallel to instance roots. Allows defining this path as tmpfs.

0 commit comments

Comments
 (0)