mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2026-03-29 08:00:08 +02:00
✅ Fix tests, cleanup
This commit is contained in:
@@ -3850,7 +3850,7 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 1590;
|
CURRENT_PROJECT_VERSION = 1595;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEBUG = YES;
|
DEBUG = YES;
|
||||||
ENABLE_APP_SANDBOX = NO;
|
ENABLE_APP_SANDBOX = NO;
|
||||||
@@ -3881,7 +3881,7 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 1590;
|
CURRENT_PROJECT_VERSION = 1595;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEBUG = NO;
|
DEBUG = NO;
|
||||||
ENABLE_APP_SANDBOX = NO;
|
ENABLE_APP_SANDBOX = NO;
|
||||||
@@ -4115,7 +4115,7 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 1590;
|
CURRENT_PROJECT_VERSION = 1595;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEBUG = NO;
|
DEBUG = NO;
|
||||||
ENABLE_APP_SANDBOX = NO;
|
ENABLE_APP_SANDBOX = NO;
|
||||||
@@ -4232,7 +4232,7 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 1590;
|
CURRENT_PROJECT_VERSION = 1595;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEBUG = YES;
|
DEBUG = YES;
|
||||||
ENABLE_APP_SANDBOX = NO;
|
ENABLE_APP_SANDBOX = NO;
|
||||||
@@ -4349,7 +4349,7 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 1590;
|
CURRENT_PROJECT_VERSION = 1595;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEBUG = YES;
|
DEBUG = YES;
|
||||||
ENABLE_APP_SANDBOX = NO;
|
ENABLE_APP_SANDBOX = NO;
|
||||||
@@ -4529,7 +4529,7 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
COMBINE_HIDPI_IMAGES = YES;
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 1590;
|
CURRENT_PROJECT_VERSION = 1595;
|
||||||
DEAD_CODE_STRIPPING = YES;
|
DEAD_CODE_STRIPPING = YES;
|
||||||
DEBUG = NO;
|
DEBUG = NO;
|
||||||
ENABLE_APP_SANDBOX = NO;
|
ENABLE_APP_SANDBOX = NO;
|
||||||
|
|||||||
@@ -172,7 +172,6 @@ struct Preset: Codable, Equatable {
|
|||||||
|
|
||||||
// MARK: - Menu Items
|
// MARK: - Menu Items
|
||||||
|
|
||||||
// swiftlint:disable void_function_in_ternary
|
|
||||||
public func getMenuItemText() -> String {
|
public func getMenuItemText() -> String {
|
||||||
var info = extensions.count == 1
|
var info = extensions.count == 1
|
||||||
? "preset.extension".localized(extensions.count)
|
? "preset.extension".localized(extensions.count)
|
||||||
@@ -197,7 +196,6 @@ struct Preset: Codable, Equatable {
|
|||||||
+ info + "</i>"
|
+ info + "</i>"
|
||||||
+ "</span>"
|
+ "</span>"
|
||||||
}
|
}
|
||||||
// swiftlint:enable void_function_in_ternary
|
|
||||||
|
|
||||||
// MARK: - Reverting
|
// MARK: - Reverting
|
||||||
|
|
||||||
|
|||||||
@@ -138,7 +138,14 @@ class TestableConfigurations {
|
|||||||
: .instant(ShellStrings.shared.brewServicesAsRoot),
|
: .instant(ShellStrings.shared.brewServicesAsRoot),
|
||||||
"/opt/homebrew/bin/brew services info --all --json"
|
"/opt/homebrew/bin/brew services info --all --json"
|
||||||
: .instant(ShellStrings.shared.brewServicesAsUser),
|
: .instant(ShellStrings.shared.brewServicesAsUser),
|
||||||
"curl -s --max-time 10 '\(Constants.Urls.DevBuildCaskFile.absoluteString)'"
|
"""
|
||||||
|
curl -s --max-time 10 \
|
||||||
|
-H "User-Agent: phpmon \(App.shortVersion)" \
|
||||||
|
-H "X-phpmon-version: \(App.bundleVersion)" \
|
||||||
|
-H "X-phpmon-os-version: \(App.macVersion)" \
|
||||||
|
-H "X-phpmon-bundle-id: \(App.identifier)" \
|
||||||
|
'\(Constants.Urls.UpdateCheckEndpoint.absoluteString)'
|
||||||
|
"""
|
||||||
: .delayed(0.5, """
|
: .delayed(0.5, """
|
||||||
cask 'phpmon-dev' do
|
cask 'phpmon-dev' do
|
||||||
depends_on formula: 'gnu-sed'
|
depends_on formula: 'gnu-sed'
|
||||||
|
|||||||
@@ -32,7 +32,14 @@ final class UpdateCheckTest: UITestCase {
|
|||||||
|
|
||||||
// Ensure an update is available
|
// Ensure an update is available
|
||||||
configuration.shellOutput[
|
configuration.shellOutput[
|
||||||
"curl -s --max-time 10 '\(Constants.Urls.DevBuildCaskFile.absoluteString)'"
|
"""
|
||||||
|
curl -s --max-time 10 \
|
||||||
|
-H "User-Agent: phpmon \(App.shortVersion)" \
|
||||||
|
-H "X-phpmon-version: \(App.bundleVersion)" \
|
||||||
|
-H "X-phpmon-os-version: \(App.macVersion)" \
|
||||||
|
-H "X-phpmon-bundle-id: \(App.identifier)" \
|
||||||
|
'\(Constants.Urls.UpdateCheckEndpoint.absoluteString)'
|
||||||
|
"""
|
||||||
] = .delayed(0.5, """
|
] = .delayed(0.5, """
|
||||||
cask 'phpmon-dev' do
|
cask 'phpmon-dev' do
|
||||||
depends_on formula: 'gnu-sed'
|
depends_on formula: 'gnu-sed'
|
||||||
@@ -64,7 +71,14 @@ final class UpdateCheckTest: UITestCase {
|
|||||||
|
|
||||||
// Ensure an update is available
|
// Ensure an update is available
|
||||||
configuration.shellOutput[
|
configuration.shellOutput[
|
||||||
"curl -s --max-time 10 '\(Constants.Urls.DevBuildCaskFile.absoluteString)'"
|
"""
|
||||||
|
curl -s --max-time 10 \
|
||||||
|
-H "User-Agent: phpmon \(App.shortVersion)" \
|
||||||
|
-H "X-phpmon-version: \(App.bundleVersion)" \
|
||||||
|
-H "X-phpmon-os-version: \(App.macVersion)" \
|
||||||
|
-H "X-phpmon-bundle-id: \(App.identifier)" \
|
||||||
|
'\(Constants.Urls.UpdateCheckEndpoint.absoluteString)'
|
||||||
|
"""
|
||||||
] = .delayed(0.5, """
|
] = .delayed(0.5, """
|
||||||
cask 'phpmon-dev' do
|
cask 'phpmon-dev' do
|
||||||
depends_on formula: 'gnu-sed'
|
depends_on formula: 'gnu-sed'
|
||||||
@@ -104,7 +118,14 @@ final class UpdateCheckTest: UITestCase {
|
|||||||
|
|
||||||
// Ensure an update is available
|
// Ensure an update is available
|
||||||
configuration.shellOutput[
|
configuration.shellOutput[
|
||||||
"curl -s --max-time 10 '\(Constants.Urls.DevBuildCaskFile.absoluteString)'"
|
"""
|
||||||
|
curl -s --max-time 10 \
|
||||||
|
-H "User-Agent: phpmon \(App.shortVersion)" \
|
||||||
|
-H "X-phpmon-version: \(App.bundleVersion)" \
|
||||||
|
-H "X-phpmon-os-version: \(App.macVersion)" \
|
||||||
|
-H "X-phpmon-bundle-id: \(App.identifier)" \
|
||||||
|
'\(Constants.Urls.UpdateCheckEndpoint.absoluteString)'
|
||||||
|
"""
|
||||||
] = .delayed(0.5, "404 PAGE NOT FOUND")
|
] = .delayed(0.5, "404 PAGE NOT FOUND")
|
||||||
|
|
||||||
// Wait for the menu to open and search for updates
|
// Wait for the menu to open and search for updates
|
||||||
|
|||||||
@@ -40,7 +40,9 @@ class CaskFileParserTest: XCTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func test_can_extract_fields_from_remote_cask_file() async throws {
|
func test_can_extract_fields_from_remote_cask_file() async throws {
|
||||||
guard let caskFile = await CaskFile.from(url: Constants.Urls.StableBuildCaskFile) else {
|
let url = URL(string: "https://raw.githubusercontent.com/nicoverbruggen/homebrew-cask/master/Casks/phpmon.rb")!
|
||||||
|
|
||||||
|
guard let caskFile = await CaskFile.from(url: url) else {
|
||||||
return XCTFail("The remote CaskFile could not be parsed, check the log for more info")
|
return XCTFail("The remote CaskFile could not be parsed, check the log for more info")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user