File tree Expand file tree Collapse file tree 2 files changed +2
-5
lines changed
Modules/Sources/Storage/GRDB
WooCommerce/Classes/ServiceLocator Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import Foundation
22import GRDB
33
44public protocol GRDBManagerProtocol {
5- init ( databasePath: String ) throws
65 var databaseConnection : GRDBDatabaseConnection { get }
76}
87
@@ -11,11 +10,8 @@ public protocol GRDBDatabaseConnection: DatabaseReader & DatabaseWriter {}
1110public final class GRDBManager : GRDBManagerProtocol {
1211
1312 public var databaseConnection : GRDBDatabaseConnection
14- private let databasePath : String
1513
1614 public init ( databasePath: String ) throws {
17- self . databasePath = databasePath
18-
1915 let databaseURL = URL ( fileURLWithPath: databasePath)
2016 let directoryURL = databaseURL. deletingLastPathComponent ( )
2117
@@ -26,8 +22,8 @@ public final class GRDBManager: GRDBManagerProtocol {
2622 try migrateIfNeeded ( )
2723 }
2824
25+ // Creates an in-memory database, intended for use in tests.
2926 init ( ) throws {
30- self . databasePath = " in-memory "
3127 self . databaseConnection = try DatabaseQueue ( )
3228 try migrateIfNeeded ( )
3329 }
Original file line number Diff line number Diff line change @@ -446,6 +446,7 @@ extension ServiceLocator {
446446 _productImageUploader = mock
447447 }
448448
449+ // periphery: ignore – for use in future tests.
449450 static func setGRDBManager( _ testInstance: GRDBManagerProtocol ) {
450451 guard isRunningTests ( ) else {
451452 return
You can’t perform that action at this time.
0 commit comments