Skip to content

Commit 9c6ce60

Browse files
committed
Periphery fixes
1 parent 283d7f6 commit 9c6ce60

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

Modules/Sources/Storage/GRDB/GRDBManager.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import Foundation
22
import GRDB
33

44
public protocol GRDBManagerProtocol {
5-
init(databasePath: String) throws
65
var databaseConnection: GRDBDatabaseConnection { get }
76
}
87

@@ -11,11 +10,8 @@ public protocol GRDBDatabaseConnection: DatabaseReader & DatabaseWriter {}
1110
public 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
}

WooCommerce/Classes/ServiceLocator/ServiceLocator.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)