1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2026-03-31 16:50:09 +02:00

Make testable modifications possible

This commit is contained in:
2026-02-27 14:51:03 +01:00
parent 7384da4d08
commit a5cca1e09d
5 changed files with 177 additions and 9 deletions

View File

@@ -73,8 +73,19 @@ final class StartupTest: UITestCase {
final func test_launch_halts_and_automic_fix_can_be_applied() throws {
var configuration = TestableConfigurations.working
// TODO: Make fake shell output closure accessible w/ container so fake tests can manipulate the app's state
configuration.shellOutput["/opt/homebrew/bin/brew link php"] = .delayed(0.5, "Linked PHP.", .stdOut)
configuration.shellOutput["/opt/homebrew/bin/brew link php"] = BatchFakeShellOutput(
items: [.delayed(0.5, "Linked PHP.", .stdOut)],
transactions: [
.symlink(
"/opt/homebrew/bin/php",
to: "/opt/homebrew/Cellar/php/8.4.5/bin/php"
),
.shellOutput(
"/opt/homebrew/bin/brew link php",
output: .instant("PHP already linked.")
)
]
)
configuration.filesystem["/opt/homebrew/bin/php"] = nil // PHP binary must be missing
let app = launch(