From f4d4feb69c9d1ffdf51cba9249874c77b49367d4 Mon Sep 17 00:00:00 2001 From: "J. King" Date: Mon, 25 Mar 2019 09:53:06 -0400 Subject: [PATCH] Suppress TLS error from mock server --- RoboFile.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/RoboFile.php b/RoboFile.php index 8df789b..a938b16 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -98,6 +98,11 @@ class RoboFile extends \Robo\Tasks { return defined("PHP_WINDOWS_VERSION_MAJOR"); } + protected function blackhole(bool $all = false): string { + $hole = $this->isWindows() ? "nul" : "/dev/null"; + return $all ? ">$hole 2>&1" : "2>$hole"; + } + protected function runTests(string $executor, string $set, array $args) : Result { switch ($set) { case "typical": @@ -117,7 +122,7 @@ class RoboFile extends \Robo\Tasks { } $execpath = realpath(self::BASE."vendor-bin/phpunit/vendor/phpunit/phpunit/phpunit"); $confpath = realpath(self::BASE_TEST."phpunit.xml"); - $this->taskServer(8000)->host("localhost")->dir(self::BASE_TEST."docroot")->rawArg("-n")->arg(self::BASE_TEST."server.php")->background()->run(); + $this->taskServer(8000)->host("localhost")->dir(self::BASE_TEST."docroot")->rawArg("-n")->arg(self::BASE_TEST."server.php")->rawArg($this->blackhole())->background()->run(); return $this->taskExec($executor)->arg($execpath)->option("-c", $confpath)->args(array_merge($set, $args))->run(); }