1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2026-03-26 06:00:07 +01:00
Files
app/tests/unit/Commands/CommandTest.swift
Nico Verbruggen 251c53b7bb Conditional tests
- RealWebApiTest requires api.phpmon.test to be reachable or skips
- CommandTest requires php binary or skips
2026-02-16 16:15:41 +01:00

32 lines
777 B
Swift

//
// CommandTest.swift
// PHP Monitor
//
// Created by Nico Verbruggen on 13/02/2021.
// Copyright © 2025 Nico Verbruggen. All rights reserved.
//
import Testing
import Foundation
struct CommandTest {
@Test(.enabled(if: Binaries.exist(paths: [
"/opt/homebrew/bin/php",
"/usr/local/bin/php"
]), "Requires PHP binary"))
func determinePhpVersion() {
let container = Container.real(minimal: true)
let version = container.command.execute(
path: container.paths.php,
arguments: ["-v"],
trimNewlines: false
)
#expect(version.contains("(cli)"))
#expect(version.contains("NTS"))
#expect(version.contains("built"))
#expect(version.contains("Zend"))
}
}