From ab020afe42b4f1e61803a746312cf2d1f669d78b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BCrk?= Date: Tue, 21 Nov 2023 15:15:47 +0100 Subject: [PATCH] [TASK] Avoid deprecated `AbstractSchemaManager::getDatabasePlatform()` The doctrine team deprecated the `AbstractSchemaManager::getDatabasePlatform()` method has been deprecated. [1] Use `Connection::getDatabasePlatform()` instead to mitigate this deprecation. [1] https://github.com/doctrine/dbal/blob/3.7.x/UPGRADE.md#deprecated-abstractschemamanagergetdatabaseplatform Releases: main --- Classes/Core/Testbase.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Classes/Core/Testbase.php b/Classes/Core/Testbase.php index a175bd97..7b40adf1 100644 --- a/Classes/Core/Testbase.php +++ b/Classes/Core/Testbase.php @@ -659,9 +659,10 @@ 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']); - $schemaManager = DriverManager::getConnection($connectionParameters)->createSchemaManager(); + $connection = DriverManager::getConnection($connectionParameters); + $schemaManager = $connection->createSchemaManager(); - if ($schemaManager->getDatabasePlatform()->getName() === 'sqlite') { + if ($connection->getDatabasePlatform()->getName() === 'sqlite') { // This is the "path" option in sqlite: one file = one db $schemaManager->dropDatabase($databaseName); } elseif (in_array($databaseName, $schemaManager->listDatabases(), true)) {