diff --git a/phpmon/Common/PHP/PHP Version/PhpEnvironments.swift b/phpmon/Common/PHP/PHP Version/PhpEnvironments.swift index ff3a299..b98e59f 100644 --- a/phpmon/Common/PHP/PHP Version/PhpEnvironments.swift +++ b/phpmon/Common/PHP/PHP Version/PhpEnvironments.swift @@ -37,6 +37,7 @@ class PhpEnvironments { from: brewPhpAlias.data(using: .utf8)! ).first! + PhpEnvironments.brewPhpAlias = self.homebrewPackage.version Log.info("[BREW] On your system, the `php` formula means version \(homebrewPackage.version).") // Check if that version actually corresponds to an older version diff --git a/phpmon/Common/Testables/TestableConfiguration.swift b/phpmon/Common/Testables/TestableConfiguration.swift index d4c66e3..94dbff7 100644 --- a/phpmon/Common/Testables/TestableConfiguration.swift +++ b/phpmon/Common/Testables/TestableConfiguration.swift @@ -63,8 +63,8 @@ public struct TestableConfiguration: Codable { : .fake(.binary), "/opt/homebrew/Cellar/php/\(version.long)/bin/php-config" : .fake(.binary), - "/opt/homebrew/etc/php/\(version.short)/php-fpm.d/www.conf" - : .fake(.text), + // "/opt/homebrew/etc/php/\(version.short)/php-fpm.d/www.conf" + // : .fake(.text), "/opt/homebrew/etc/php/\(version.short)/php-fpm.d/valet-fpm.conf" : .fake(.text), "/opt/homebrew/etc/php/\(version.short)/php.ini" @@ -94,7 +94,7 @@ public struct TestableConfiguration: Codable { /opt/homebrew/etc/php/\(version.short)/conf.d/php-memory-limits.ini, """ } else { - + self.shellOutput["sudo /opt/homebrew/bin/brew services stop php@\(version.short)"] = .instant("") self.shellOutput["ls /opt/homebrew/opt | grep php@"] = BatchFakeShellOutput.instant( self.secondaryPhpVersions diff --git a/phpmon/Domain/Integrations/Homebrew/BrewFormula.swift b/phpmon/Domain/Integrations/Homebrew/BrewFormula.swift index 535f4e8..e46624f 100644 --- a/phpmon/Domain/Integrations/Homebrew/BrewFormula.swift +++ b/phpmon/Domain/Integrations/Homebrew/BrewFormula.swift @@ -55,7 +55,7 @@ struct BrewFormula: Equatable { } var unavailableAfterUpgrade: Bool { - if (installedVersion == nil || upgradeVersion == nil) { + if installedVersion == nil || upgradeVersion == nil { return false } diff --git a/tests/ui/MainMenuTest.swift b/tests/ui/MainMenuTest.swift index e3eb0cd..d3ceba1 100644 --- a/tests/ui/MainMenuTest.swift +++ b/tests/ui/MainMenuTest.swift @@ -80,16 +80,17 @@ final class MainMenuTest: UITestCase { // Should display loader assertExists(app.staticTexts["phpman.busy.title".localized], 1) - // After loading, should display PHP 8.2 + // After loading, should display PHP 8.2 and PHP 8.3 assertExists(app.staticTexts["PHP 8.2"], 5) + assertExists(app.staticTexts["PHP 8.3"]) // Should also display pre-release version - assertExists(app.staticTexts["PHP 8.3"]) + assertExists(app.staticTexts["PHP 8.4"]) assertExists(app.staticTexts["phpman.version.prerelease".localized.uppercased()]) assertExists(app.staticTexts["phpman.version.available_for_installation".localized]) - // But not PHP 8.4 (yet) - assertNotExists(app.staticTexts["PHP 8.4"]) + // But not PHP 8.5 (yet) + assertNotExists(app.staticTexts["PHP 8.5"]) // Also, PHP 8.2 should have an update available assertExists(app.staticTexts["phpman.version.has_update".localized(