mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-07 20:10:08 +02:00
✅ Add test plan, fix unit tests
This commit is contained in:
52
PHP Monitor.xcodeproj/PHP Monitor.xctestplan
Normal file
52
PHP Monitor.xcodeproj/PHP Monitor.xctestplan
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
{
|
||||||
|
"configurations" : [
|
||||||
|
{
|
||||||
|
"id" : "98F42C11-E6D2-4AD9-A5CA-40EFE44F384A",
|
||||||
|
"name" : "Configuration 1",
|
||||||
|
"options" : {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"defaultOptions" : {
|
||||||
|
"codeCoverage" : false,
|
||||||
|
"commandLineArgumentEntries" : [
|
||||||
|
{
|
||||||
|
"argument" : "--v",
|
||||||
|
"enabled" : false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"environmentVariableEntries" : [
|
||||||
|
{
|
||||||
|
"enabled" : false,
|
||||||
|
"key" : "EXTREME_DOCTOR_MODE",
|
||||||
|
"value" : ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enabled" : false,
|
||||||
|
"key" : "SLOW_SHELL_MODE",
|
||||||
|
"value" : ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enabled" : false,
|
||||||
|
"key" : "PAINT_PHPMON_SWIFTUI_VIEWS",
|
||||||
|
"value" : ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"targetForVariableExpansion" : {
|
||||||
|
"containerPath" : "container:PHP Monitor.xcodeproj",
|
||||||
|
"identifier" : "C41C1B3222B0097F00E7CF16",
|
||||||
|
"name" : "PHP Monitor"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"testTargets" : [
|
||||||
|
{
|
||||||
|
"target" : {
|
||||||
|
"containerPath" : "container:PHP Monitor.xcodeproj",
|
||||||
|
"identifier" : "C4F7807825D7F84B000DBC97",
|
||||||
|
"name" : "phpmon-tests"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version" : 1
|
||||||
|
}
|
@ -159,6 +159,9 @@
|
|||||||
C46FA9892822EFDC00D78807 /* PhpConfigurationFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = C46FA9872822EFDC00D78807 /* PhpConfigurationFile.swift */; };
|
C46FA9892822EFDC00D78807 /* PhpConfigurationFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = C46FA9872822EFDC00D78807 /* PhpConfigurationFile.swift */; };
|
||||||
C46FA98C2822F08F00D78807 /* PhpConfigurationTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = C46FA98A2822F08F00D78807 /* PhpConfigurationTest.swift */; };
|
C46FA98C2822F08F00D78807 /* PhpConfigurationTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = C46FA98A2822F08F00D78807 /* PhpConfigurationTest.swift */; };
|
||||||
C4709CA228524B3400088BB8 /* StatsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4709CA128524B3400088BB8 /* StatsView.swift */; };
|
C4709CA228524B3400088BB8 /* StatsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4709CA128524B3400088BB8 /* StatsView.swift */; };
|
||||||
|
C471E79328F9B21F0021E251 /* ActiveFileSystem.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4C8900628F0E3EF00CE5E97 /* ActiveFileSystem.swift */; };
|
||||||
|
C471E79428F9B23B0021E251 /* FileSystemProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4C8900228F0E28800CE5E97 /* FileSystemProtocol.swift */; };
|
||||||
|
C471E79528F9B2420021E251 /* RealFileSystem.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4C8900428F0E3D100CE5E97 /* RealFileSystem.swift */; };
|
||||||
C473319F2470923A009A0597 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = C473319E2470923A009A0597 /* Localizable.strings */; };
|
C473319F2470923A009A0597 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = C473319E2470923A009A0597 /* Localizable.strings */; };
|
||||||
C47331A2247093B7009A0597 /* StatusMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = C47331A1247093B7009A0597 /* StatusMenu.swift */; };
|
C47331A2247093B7009A0597 /* StatusMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = C47331A1247093B7009A0597 /* StatusMenu.swift */; };
|
||||||
C474B00624C0E98C00066A22 /* LocalNotification.swift in Sources */ = {isa = PBXBuildFile; fileRef = C474B00524C0E98C00066A22 /* LocalNotification.swift */; };
|
C474B00624C0E98C00066A22 /* LocalNotification.swift in Sources */ = {isa = PBXBuildFile; fileRef = C474B00524C0E98C00066A22 /* LocalNotification.swift */; };
|
||||||
@ -443,6 +446,7 @@
|
|||||||
C46FA9872822EFDC00D78807 /* PhpConfigurationFile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhpConfigurationFile.swift; sourceTree = "<group>"; };
|
C46FA9872822EFDC00D78807 /* PhpConfigurationFile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhpConfigurationFile.swift; sourceTree = "<group>"; };
|
||||||
C46FA98A2822F08F00D78807 /* PhpConfigurationTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhpConfigurationTest.swift; sourceTree = "<group>"; };
|
C46FA98A2822F08F00D78807 /* PhpConfigurationTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhpConfigurationTest.swift; sourceTree = "<group>"; };
|
||||||
C4709CA128524B3400088BB8 /* StatsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatsView.swift; sourceTree = "<group>"; };
|
C4709CA128524B3400088BB8 /* StatsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatsView.swift; sourceTree = "<group>"; };
|
||||||
|
C471E79228F9B1D30021E251 /* PHP Monitor.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; name = "PHP Monitor.xctestplan"; path = "PHP Monitor.xcodeproj/PHP Monitor.xctestplan"; sourceTree = "<group>"; };
|
||||||
C473319E2470923A009A0597 /* Localizable.strings */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; path = Localizable.strings; sourceTree = "<group>"; };
|
C473319E2470923A009A0597 /* Localizable.strings */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; path = Localizable.strings; sourceTree = "<group>"; };
|
||||||
C47331A1247093B7009A0597 /* StatusMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusMenu.swift; sourceTree = "<group>"; };
|
C47331A1247093B7009A0597 /* StatusMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusMenu.swift; sourceTree = "<group>"; };
|
||||||
C474B00524C0E98C00066A22 /* LocalNotification.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalNotification.swift; sourceTree = "<group>"; };
|
C474B00524C0E98C00066A22 /* LocalNotification.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalNotification.swift; sourceTree = "<group>"; };
|
||||||
@ -697,6 +701,7 @@
|
|||||||
C4168F4427ADB4A3003B6C39 /* DEVELOPER.md */,
|
C4168F4427ADB4A3003B6C39 /* DEVELOPER.md */,
|
||||||
54D9E0C027E4F5E9003B9AD9 /* LICENSE */,
|
54D9E0C027E4F5E9003B9AD9 /* LICENSE */,
|
||||||
C4F5FBCC28218C93001065C5 /* .swiftlint.yml */,
|
C4F5FBCC28218C93001065C5 /* .swiftlint.yml */,
|
||||||
|
C471E79228F9B1D30021E251 /* PHP Monitor.xctestplan */,
|
||||||
C4E713572570151400007428 /* docs */,
|
C4E713572570151400007428 /* docs */,
|
||||||
C41C1B3522B0097F00E7CF16 /* phpmon */,
|
C41C1B3522B0097F00E7CF16 /* phpmon */,
|
||||||
C4F7807A25D7F84B000DBC97 /* phpmon-tests */,
|
C4F7807A25D7F84B000DBC97 /* phpmon-tests */,
|
||||||
@ -1581,6 +1586,7 @@
|
|||||||
C46EBC4528DB95F0007ACC74 /* ShellProtocol.swift in Sources */,
|
C46EBC4528DB95F0007ACC74 /* ShellProtocol.swift in Sources */,
|
||||||
C44B3A4728E5C70100718CB1 /* TimeIntervalExtension.swift in Sources */,
|
C44B3A4728E5C70100718CB1 /* TimeIntervalExtension.swift in Sources */,
|
||||||
C4F780C425D80B75000DBC97 /* MainMenu.swift in Sources */,
|
C4F780C425D80B75000DBC97 /* MainMenu.swift in Sources */,
|
||||||
|
C471E79528F9B2420021E251 /* RealFileSystem.swift in Sources */,
|
||||||
54FCFD2B276C8AA4004CE748 /* CheckboxPreferenceView.swift in Sources */,
|
54FCFD2B276C8AA4004CE748 /* CheckboxPreferenceView.swift in Sources */,
|
||||||
C415D3B82770F294005EF286 /* Actions.swift in Sources */,
|
C415D3B82770F294005EF286 /* Actions.swift in Sources */,
|
||||||
54B48B60275F66AE006D90C5 /* Application.swift in Sources */,
|
54B48B60275F66AE006D90C5 /* Application.swift in Sources */,
|
||||||
@ -1661,6 +1667,7 @@
|
|||||||
C4080FF727BD8C6400BF2C6B /* BetterAlert.swift in Sources */,
|
C4080FF727BD8C6400BF2C6B /* BetterAlert.swift in Sources */,
|
||||||
C4B97B7C275CF20A003F3378 /* App+GlobalHotkey.swift in Sources */,
|
C4B97B7C275CF20A003F3378 /* App+GlobalHotkey.swift in Sources */,
|
||||||
5489625928313231004F647A /* CreatedFromFile.swift in Sources */,
|
5489625928313231004F647A /* CreatedFromFile.swift in Sources */,
|
||||||
|
C471E79328F9B21F0021E251 /* ActiveFileSystem.swift in Sources */,
|
||||||
54D9E0B327E4F51E003B9AD9 /* HotKeysController.swift in Sources */,
|
54D9E0B327E4F51E003B9AD9 /* HotKeysController.swift in Sources */,
|
||||||
03E36FE828D9219000636F7F /* ActiveShell.swift in Sources */,
|
03E36FE828D9219000636F7F /* ActiveShell.swift in Sources */,
|
||||||
C4B97B79275CF1B5003F3378 /* App+ActivationPolicy.swift in Sources */,
|
C4B97B79275CF1B5003F3378 /* App+ActivationPolicy.swift in Sources */,
|
||||||
@ -1686,6 +1693,7 @@
|
|||||||
C4D9ADC9277611A0007277F4 /* InternalSwitcher.swift in Sources */,
|
C4D9ADC9277611A0007277F4 /* InternalSwitcher.swift in Sources */,
|
||||||
C449B4F227EE7FC400C47E8A /* DomainListPhpCell.swift in Sources */,
|
C449B4F227EE7FC400C47E8A /* DomainListPhpCell.swift in Sources */,
|
||||||
C42CFB1A27DFE8BD00862737 /* NginxConfigurationTest.swift in Sources */,
|
C42CFB1A27DFE8BD00862737 /* NginxConfigurationTest.swift in Sources */,
|
||||||
|
C471E79428F9B23B0021E251 /* FileSystemProtocol.swift in Sources */,
|
||||||
C4F30B0B278E203C00755FCE /* MainMenu+Startup.swift in Sources */,
|
C4F30B0B278E203C00755FCE /* MainMenu+Startup.swift in Sources */,
|
||||||
C485707C28BF459500539B36 /* NoWarningsView.swift in Sources */,
|
C485707C28BF459500539B36 /* NoWarningsView.swift in Sources */,
|
||||||
C4F5FBCD28218CB8001065C5 /* Xdebug.swift in Sources */,
|
C4F5FBCD28218CB8001065C5 /* Xdebug.swift in Sources */,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<Scheme
|
<Scheme
|
||||||
LastUpgradeVersion = "1400"
|
LastUpgradeVersion = "1400"
|
||||||
version = "1.3">
|
version = "1.7">
|
||||||
<BuildAction
|
<BuildAction
|
||||||
parallelizeBuildables = "YES"
|
parallelizeBuildables = "YES"
|
||||||
buildImplicitDependencies = "YES">
|
buildImplicitDependencies = "YES">
|
||||||
@ -27,6 +27,12 @@
|
|||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
|
<TestPlans>
|
||||||
|
<TestPlanReference
|
||||||
|
reference = "container:PHP Monitor.xcodeproj/PHP Monitor.xctestplan"
|
||||||
|
default = "YES">
|
||||||
|
</TestPlanReference>
|
||||||
|
</TestPlans>
|
||||||
<Testables>
|
<Testables>
|
||||||
<TestableReference
|
<TestableReference
|
||||||
skipped = "NO">
|
skipped = "NO">
|
||||||
|
@ -0,0 +1,52 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Scheme
|
||||||
|
LastUpgradeVersion = "1400"
|
||||||
|
version = "1.3">
|
||||||
|
<BuildAction
|
||||||
|
parallelizeBuildables = "YES"
|
||||||
|
buildImplicitDependencies = "YES">
|
||||||
|
</BuildAction>
|
||||||
|
<TestAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
|
<Testables>
|
||||||
|
<TestableReference
|
||||||
|
skipped = "NO">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "C4F7807825D7F84B000DBC97"
|
||||||
|
BuildableName = "phpmon-tests.xctest"
|
||||||
|
BlueprintName = "phpmon-tests"
|
||||||
|
ReferencedContainer = "container:PHP Monitor.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</TestableReference>
|
||||||
|
</Testables>
|
||||||
|
</TestAction>
|
||||||
|
<LaunchAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
launchStyle = "0"
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
|
debugDocumentVersioning = "YES"
|
||||||
|
debugServiceExtension = "internal"
|
||||||
|
allowLocationSimulation = "YES">
|
||||||
|
</LaunchAction>
|
||||||
|
<ProfileAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
|
savedToolIdentifier = ""
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
debugDocumentVersioning = "YES">
|
||||||
|
</ProfileAction>
|
||||||
|
<AnalyzeAction
|
||||||
|
buildConfiguration = "Debug">
|
||||||
|
</AnalyzeAction>
|
||||||
|
<ArchiveAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
revealArchiveInOrganizer = "YES">
|
||||||
|
</ArchiveAction>
|
||||||
|
</Scheme>
|
@ -13,7 +13,8 @@ class CommandTest: XCTestCase {
|
|||||||
func testDeterminePhpVersion() {
|
func testDeterminePhpVersion() {
|
||||||
let version = Command.execute(
|
let version = Command.execute(
|
||||||
path: Paths.php,
|
path: Paths.php,
|
||||||
arguments: ["-v"]
|
arguments: ["-v"],
|
||||||
|
trimNewlines: false
|
||||||
)
|
)
|
||||||
|
|
||||||
XCTAssert(version.contains("(cli)"))
|
XCTAssert(version.contains("(cli)"))
|
||||||
|
@ -16,7 +16,7 @@ class SystemShellTest: XCTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func test_system_shell_is_default() async {
|
func test_system_shell_is_default() async {
|
||||||
XCTAssertTrue(Shell is SystemShell)
|
XCTAssertTrue(Shell is RealShell)
|
||||||
|
|
||||||
let output = await Shell.pipe("php -v")
|
let output = await Shell.pipe("php -v")
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ class SystemShellTest: XCTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func test_system_shell_has_path() {
|
func test_system_shell_has_path() {
|
||||||
let systemShell = Shell as! SystemShell
|
let systemShell = Shell as! RealShell
|
||||||
|
|
||||||
XCTAssertTrue(systemShell.PATH.contains(":/usr/local/bin"))
|
XCTAssertTrue(systemShell.PATH.contains(":/usr/local/bin"))
|
||||||
XCTAssertTrue(systemShell.PATH.contains(":/usr/bin"))
|
XCTAssertTrue(systemShell.PATH.contains(":/usr/bin"))
|
||||||
|
@ -86,9 +86,14 @@ class PhpExtension {
|
|||||||
|
|
||||||
enabled.toggle()
|
enabled.toggle()
|
||||||
|
|
||||||
DispatchQueue.main.async {
|
if !isRunningTests {
|
||||||
MainMenu.shared.rebuild(async: false)
|
// When running unit tests, the MainMenu will not be available
|
||||||
|
// TODO: Fix this dependency issue, set up a notification mechanism
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
MainMenu.shared.rebuild(async: false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Static Methods
|
// MARK: - Static Methods
|
||||||
|
Reference in New Issue
Block a user