{self::DB_GROUP} ?? []; try { $db = Database::connect(self::DB_GROUP); $db->initialize(); } catch (Throwable $exception) { throw new \RuntimeException( sprintf( 'Test database connection failed: group=%s host=%s port=%s database=%s', self::DB_GROUP, $dbConfig['hostname'] ?? '', $dbConfig['port'] ?? '', $dbConfig['database'] ?? '' ), 0, $exception ); } $db->disableForeignKeyChecks(); $tables = $db->listTables(); foreach ($tables as $table) { if (!in_array($table, self::$excludeTables)) { $db->query('TRUNCATE TABLE ' . $db->escapeIdentifiers($table)); } } $db->enableForeignKeyChecks(); } }