Files
2025-12-03 16:48:23 +01:00

29 lines
968 B
Swift

// SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
// SPDX-License-Identifier: LGPL-3.0-or-later
import XCTest
///
/// Common base class for all tests in this target.
///
class NextcloudFileProviderKitTestCase: XCTestCase {
///
/// Create a unique and temporary directory for Realm database testing purposes.
///
/// - Returns: A URL pointing to a temporary directory which also contains a UUID to distinguish it clearly from any other calls.
///
static func makeDatabaseDirectory() -> URL {
let url = FileManager.default.temporaryDirectory.appendingPathComponent(UUID().uuidString, isDirectory: true)
try! FileManager.default.createDirectory(at: url, withIntermediateDirectories: true)
return url
}
///
/// Instance wrapper for ``makeDatabaseDirectory`` for convenience and brevity.
///
func makeDatabaseDirectory() -> URL {
Self.makeDatabaseDirectory()
}
}