1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-07 03:50:08 +02:00

👌 Parse upgradable versions

This commit is contained in:
2023-03-18 02:11:57 +01:00
parent 8f1304308d
commit f8b605f749
6 changed files with 79 additions and 33 deletions

View File

@ -8,7 +8,7 @@
import XCTest
class HomebrewTest: XCTestCase {
class HomebrewUpgradableTest: XCTestCase {
static var outdatedFileUrl: URL {
return Bundle(for: Self.self)
.url(forResource: "brew-outdated", withExtension: "json")!
@ -21,13 +21,20 @@ class HomebrewTest: XCTestCase {
let env = PhpEnv.shared
env.cachedPhpInstallations = [
"8.1": PhpInstallation("8.1.3"),
"8.2": PhpInstallation("8.2.4"),
"8.1": PhpInstallation("8.1.16"),
"8.2": PhpInstallation("8.2.3"),
"7.4": PhpInstallation("7.4.11")
]
let brew = Brew.shared
let data = await brew.getPhpVersions()
print(data)
XCTAssertTrue(data.contains(where: { formula in
formula.installedVersion == "8.1.16" && formula.upgradeVersion == "8.1.17"
}))
XCTAssertTrue(data.contains(where: { formula in
formula.installedVersion == "8.2.3" && formula.upgradeVersion == "8.2.4"
}))
}
}