From c4ca2103e4f35c6ec905841e2609d8e0faa0e276 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Sun, 15 May 2022 00:16:01 +0800 Subject: [PATCH] fix phpunit-swoole class name --- bin/phpunit-swoole | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/phpunit-swoole b/bin/phpunit-swoole index 1bc0ee32..9a2898b1 100755 --- a/bin/phpunit-swoole +++ b/bin/phpunit-swoole @@ -9,10 +9,11 @@ use PHPUnit\Runner\Version; use PHPUnit\TextUI\TestRunner; use Swoole\Coroutine; use ZM\Annotation\Swoole\OnStart; -use ZM\Command\RunServerCommand; +use ZM\Command\Server\ServerStartCommand; use ZM\Console\Console; use ZM\ConsoleApplication; use ZM\Event\EventManager; +use ZM\Exception\ConfigException; use ZM\Framework; use ZM\Store\ZMAtomic; use ZM\Utils\ZMUtil; @@ -71,7 +72,7 @@ chdir(__DIR__ . '/../'); $options = array_map(function ($x) { return $x->getDefault(); -}, RunServerCommand::exportDefinition()->getOptions()); +}, ServerStartCommand::exportDefinition()->getOptions()); $options['disable-safe-exit'] = true; $options['worker-num'] = 1; $options['private-mode'] = true; @@ -90,7 +91,12 @@ spl_autoload_register(static function ($class) { }, true, true); Console::setLevel(0); -$framework = new Framework($options); +try { + $framework = new Framework($options); +} catch (ConfigException $e) { + echo $e->getMessage(); + exit(1); +} $start = new OnStart(); $start->method = function () { try {