From 4de7179d1ca6388930c1b05a2b2d9758100bc754 Mon Sep 17 00:00:00 2001 From: Nico Verbruggen Date: Wed, 2 Nov 2022 20:08:15 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8C=20Include=20`brew=20(un)link`=20co?= =?UTF-8?q?mmands=20for=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- phpmon/Domain/Watcher/PhpConfigWatcher.swift | 5 ++++- tests/Shared/TestableConfigurations.swift | 20 +++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/phpmon/Domain/Watcher/PhpConfigWatcher.swift b/phpmon/Domain/Watcher/PhpConfigWatcher.swift index 62ce21a..9758a78 100644 --- a/phpmon/Domain/Watcher/PhpConfigWatcher.swift +++ b/phpmon/Domain/Watcher/PhpConfigWatcher.swift @@ -22,7 +22,10 @@ class PhpConfigWatcher { init(for url: URL) { if FileSystem is TestableFileSystem { - fatalError("PhpConfigWatcher is not compatible with testable FS! You are not allowed to instantiate these while using a testable FS.") + fatalError(""" + PhpConfigWatcher is not compatible with testable FS! " + You are not allowed to instantiate these while using a testable FS. + """) } self.url = url diff --git a/tests/Shared/TestableConfigurations.swift b/tests/Shared/TestableConfigurations.swift index 6578865..c7aa016 100644 --- a/tests/Shared/TestableConfigurations.swift +++ b/tests/Shared/TestableConfigurations.swift @@ -135,7 +135,25 @@ class TestableConfigurations { "/opt/homebrew/bin/brew services info --all --json" : .instant(ShellStrings.shared.brewServicesAsUser), "curl -s --max-time 5 '\(Constants.Urls.StableBuildCaskFile.absoluteString)' | grep version" - : .instant("version '5.6.2_976'") + : .instant("version '5.6.2_976'"), + "/opt/homebrew/bin/brew unlink php" + : .delayed(0.2, "OK"), + "/opt/homebrew/bin/brew link php --overwrite --force" + : .delayed(0.2, "OK"), + "sudo /opt/homebrew/bin/brew services stop php" + : .delayed(0.2, "OK"), + "sudo /opt/homebrew/bin/brew services start php" + : .delayed(0.2, "OK"), + "sudo /opt/homebrew/bin/brew services stop nginx" + : .delayed(0.2, "OK"), + "sudo /opt/homebrew/bin/brew services start nginx" + : .delayed(0.2, "OK"), + "sudo /opt/homebrew/bin/brew services stop dnsmasq" + : .delayed(0.2, "OK"), + "sudo /opt/homebrew/bin/brew services start dnsmasq" + : .delayed(0.2, "OK"), + "ln -sF ~/.config/valet/valet81.sock ~/.config/valet/valet.sock" + : .instant("OK"), ], commandOutput: [ "/opt/homebrew/bin/php-config --version": "8.1.10",