mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2026-04-01 17:20:09 +02:00
✅ Fix unit tests
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user