diff --git a/Classes/Core/Testbase.php b/Classes/Core/Testbase.php index 725ac014..78dbacb7 100644 --- a/Classes/Core/Testbase.php +++ b/Classes/Core/Testbase.php @@ -661,7 +661,16 @@ public function setUpTestDatabase(string $databaseName, string $originalDatabase // @todo: This should by now work with using "our" ConnectionPool again, it does now, though. $connectionParameters = $GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']; unset($connectionParameters['dbname']); - $connection = DriverManager::getConnection($connectionParameters); + $configuration = (new Configuration())->setSchemaManagerFactory(GeneralUtility::makeInstance(DefaultSchemaManagerFactory::class)); + // @todo Remove class exist check if supported minimal TYPO3 version is raised to v13+. + if (class_exists(\TYPO3\CMS\Core\Database\Schema\SchemaManager\CoreSchemaManagerFactory::class)) { + /** @var SchemaManagerFactory|\TYPO3\CMS\Core\Database\Schema\SchemaManager\CoreSchemaManagerFactory $coreSchemaFactory */ + $coreSchemaFactory = GeneralUtility::makeInstance( + \TYPO3\CMS\Core\Database\Schema\SchemaManager\CoreSchemaManagerFactory::class + ); + $configuration->setSchemaManagerFactory($coreSchemaFactory); + } + $connection = DriverManager::getConnection($connectionParameters, $connection); $schemaManager = $connection->createSchemaManager(); $platform = $connection->getDatabasePlatform(); $isSQLite = $platform instanceof DoctrineSQLitePlatform;