mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-07 03:50:08 +02:00
✅ Fix tests
This commit is contained in:
@ -20,15 +20,14 @@ class HomebrewUpgradableTest: XCTestCase {
|
|||||||
: .instant(try! String(contentsOf: Self.outdatedFileUrl))
|
: .instant(try! String(contentsOf: Self.outdatedFileUrl))
|
||||||
])
|
])
|
||||||
|
|
||||||
let env = PhpEnv.shared
|
let env = PhpEnvironments.shared
|
||||||
env.cachedPhpInstallations = [
|
env.cachedPhpInstallations = [
|
||||||
"8.1": PhpInstallation("8.1.16"),
|
"8.1": PhpInstallation("8.1.16"),
|
||||||
"8.2": PhpInstallation("8.2.3"),
|
"8.2": PhpInstallation("8.2.3"),
|
||||||
"7.4": PhpInstallation("7.4.11")
|
"7.4": PhpInstallation("7.4.11")
|
||||||
]
|
]
|
||||||
|
|
||||||
let brew = Brew.shared
|
let data = await BrewFormulaeHandler().loadPhpVersions(loadOutdated: true)
|
||||||
let data = await brew.getPhpVersions()
|
|
||||||
|
|
||||||
XCTAssertTrue(data.contains(where: { formula in
|
XCTAssertTrue(data.contains(where: { formula in
|
||||||
formula.installedVersion == "8.1.16" && formula.upgradeVersion == "8.1.17"
|
formula.installedVersion == "8.1.16" && formula.upgradeVersion == "8.1.17"
|
||||||
|
@ -60,7 +60,7 @@ class RealShellTest: XCTestCase {
|
|||||||
expectation.fulfill()
|
expectation.fulfill()
|
||||||
}
|
}
|
||||||
|
|
||||||
wait(for: [expectation], timeout: 5.0)
|
await fulfillment(of: [expectation], timeout: 5.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func test_system_processes_run_in_parallel() async {
|
func test_system_processes_run_in_parallel() async {
|
||||||
@ -74,6 +74,6 @@ class RealShellTest: XCTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await thing()
|
await thing()
|
||||||
wait(for: [expectation], timeout: 1.0)
|
await fulfillment(of: [expectation], timeout: 5.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ import XCTest
|
|||||||
class PhpVersionDetectionTest: XCTestCase {
|
class PhpVersionDetectionTest: XCTestCase {
|
||||||
|
|
||||||
func test_can_detect_valid_php_versions() async throws {
|
func test_can_detect_valid_php_versions() async throws {
|
||||||
let outcome = await PhpEnv.shared.extractPhpVersions(
|
let outcome = await PhpEnvironments.shared.extractPhpVersions(
|
||||||
from: [
|
from: [
|
||||||
"", // empty lines should be omitted
|
"", // empty lines should be omitted
|
||||||
"php@8.0",
|
"php@8.0",
|
||||||
|
Reference in New Issue
Block a user