mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-07 20:10:08 +02:00
✅ Fix broken tests
This commit is contained in:
@ -37,6 +37,7 @@ class PhpEnvironments {
|
|||||||
from: brewPhpAlias.data(using: .utf8)!
|
from: brewPhpAlias.data(using: .utf8)!
|
||||||
).first!
|
).first!
|
||||||
|
|
||||||
|
PhpEnvironments.brewPhpAlias = self.homebrewPackage.version
|
||||||
Log.info("[BREW] On your system, the `php` formula means version \(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
|
// Check if that version actually corresponds to an older version
|
||||||
|
@ -63,8 +63,8 @@ public struct TestableConfiguration: Codable {
|
|||||||
: .fake(.binary),
|
: .fake(.binary),
|
||||||
"/opt/homebrew/Cellar/php/\(version.long)/bin/php-config"
|
"/opt/homebrew/Cellar/php/\(version.long)/bin/php-config"
|
||||||
: .fake(.binary),
|
: .fake(.binary),
|
||||||
"/opt/homebrew/etc/php/\(version.short)/php-fpm.d/www.conf"
|
// "/opt/homebrew/etc/php/\(version.short)/php-fpm.d/www.conf"
|
||||||
: .fake(.text),
|
// : .fake(.text),
|
||||||
"/opt/homebrew/etc/php/\(version.short)/php-fpm.d/valet-fpm.conf"
|
"/opt/homebrew/etc/php/\(version.short)/php-fpm.d/valet-fpm.conf"
|
||||||
: .fake(.text),
|
: .fake(.text),
|
||||||
"/opt/homebrew/etc/php/\(version.short)/php.ini"
|
"/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,
|
/opt/homebrew/etc/php/\(version.short)/conf.d/php-memory-limits.ini,
|
||||||
"""
|
"""
|
||||||
} else {
|
} else {
|
||||||
|
self.shellOutput["sudo /opt/homebrew/bin/brew services stop php@\(version.short)"] = .instant("")
|
||||||
self.shellOutput["ls /opt/homebrew/opt | grep php@"] =
|
self.shellOutput["ls /opt/homebrew/opt | grep php@"] =
|
||||||
BatchFakeShellOutput.instant(
|
BatchFakeShellOutput.instant(
|
||||||
self.secondaryPhpVersions
|
self.secondaryPhpVersions
|
||||||
|
@ -55,7 +55,7 @@ struct BrewFormula: Equatable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var unavailableAfterUpgrade: Bool {
|
var unavailableAfterUpgrade: Bool {
|
||||||
if (installedVersion == nil || upgradeVersion == nil) {
|
if installedVersion == nil || upgradeVersion == nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,16 +80,17 @@ final class MainMenuTest: UITestCase {
|
|||||||
// Should display loader
|
// Should display loader
|
||||||
assertExists(app.staticTexts["phpman.busy.title".localized], 1)
|
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.2"], 5)
|
||||||
|
assertExists(app.staticTexts["PHP 8.3"])
|
||||||
|
|
||||||
// Should also display pre-release version
|
// 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.prerelease".localized.uppercased()])
|
||||||
assertExists(app.staticTexts["phpman.version.available_for_installation".localized])
|
assertExists(app.staticTexts["phpman.version.available_for_installation".localized])
|
||||||
|
|
||||||
// But not PHP 8.4 (yet)
|
// But not PHP 8.5 (yet)
|
||||||
assertNotExists(app.staticTexts["PHP 8.4"])
|
assertNotExists(app.staticTexts["PHP 8.5"])
|
||||||
|
|
||||||
// Also, PHP 8.2 should have an update available
|
// Also, PHP 8.2 should have an update available
|
||||||
assertExists(app.staticTexts["phpman.version.has_update".localized(
|
assertExists(app.staticTexts["phpman.version.has_update".localized(
|
||||||
|
Reference in New Issue
Block a user