mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-06 19:40:08 +02:00
✅ Fix broken tests
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
|
@ -55,7 +55,7 @@ struct BrewFormula: Equatable {
|
||||
}
|
||||
|
||||
var unavailableAfterUpgrade: Bool {
|
||||
if (installedVersion == nil || upgradeVersion == nil) {
|
||||
if installedVersion == nil || upgradeVersion == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
|
@ -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(
|
||||
|
Reference in New Issue
Block a user