1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2026-04-01 09:10:08 +02:00

Fix unit tests

This commit is contained in:
2025-10-16 19:00:02 +02:00
parent 515f7d59a4
commit c43f16d0d5
2 changed files with 5 additions and 5 deletions

View File

@@ -14,7 +14,7 @@ final class InternalSwitcherTest: FeatureTestCase {
"/opt/homebrew/etc/php/8.1/php-fpm.d/www.conf": .fake(.text) "/opt/homebrew/etc/php/8.1/php-fpm.d/www.conf": .fake(.text)
]), fs = c.filesystem as! TestableFileSystem ]), fs = c.filesystem as! TestableFileSystem
let outcome = await InternalSwitcher(container: c) let outcome = await InternalSwitcher(c)
.disableDefaultPhpFpmPool("8.1") .disableDefaultPhpFpmPool("8.1")
XCTAssertTrue(outcome) XCTAssertTrue(outcome)
@@ -24,15 +24,15 @@ final class InternalSwitcherTest: FeatureTestCase {
} }
public func testExistingDisabledByPhpMonFileIsRemoved() async { public func testExistingDisabledByPhpMonFileIsRemoved() async {
let c = Container.fake(files: [ let container = Container.fake(files: [
"/opt/homebrew/etc/php/8.1/php-fpm.d/www.conf": .fake(.text, "system generated"), "/opt/homebrew/etc/php/8.1/php-fpm.d/www.conf": .fake(.text, "system generated"),
"/opt/homebrew/etc/php/8.1/php-fpm.d/www.conf.disabled-by-phpmon": .fake(.text, "phpmon generated") "/opt/homebrew/etc/php/8.1/php-fpm.d/www.conf.disabled-by-phpmon": .fake(.text, "phpmon generated")
]), fs = c.filesystem as! TestableFileSystem ]), fs = container.filesystem as! TestableFileSystem
assertFileHasContents("/opt/homebrew/etc/php/8.1/php-fpm.d/www.conf.disabled-by-phpmon", assertFileHasContents("/opt/homebrew/etc/php/8.1/php-fpm.d/www.conf.disabled-by-phpmon",
contents: "phpmon generated", in: fs) contents: "phpmon generated", in: fs)
let outcome = await InternalSwitcher(container: c).disableDefaultPhpFpmPool("8.1") let outcome = await InternalSwitcher(container).disableDefaultPhpFpmPool("8.1")
XCTAssertTrue(outcome) XCTAssertTrue(outcome)
assertFileSystemHas("/opt/homebrew/etc/php/8.1/php-fpm.d/www.conf.disabled-by-phpmon", in: fs) assertFileSystemHas("/opt/homebrew/etc/php/8.1/php-fpm.d/www.conf.disabled-by-phpmon", in: fs)

View File

@@ -47,7 +47,7 @@ struct HomebrewUpgradableTest {
"7.4": PhpInstallation(container, "7.4.11") "7.4": PhpInstallation(container, "7.4.11")
] ]
let data = await BrewPhpFormulaeHandler(container: container) let data = await BrewPhpFormulaeHandler(container)
.loadPhpVersions(loadOutdated: true) .loadPhpVersions(loadOutdated: true)
#expect(true == data.contains(where: { formula in #expect(true == data.contains(where: { formula in