mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-03-17 20:54:52 +08:00
fix phpunit not bootstrapped
This commit is contained in:
parent
cf72893421
commit
8a58b69243
@ -52,11 +52,18 @@ ob_event_provider()->addEventListener(WorkerStartEvent::getName(), function () {
|
||||
}
|
||||
}, 1);
|
||||
|
||||
try {
|
||||
$options = ServerStartCommand::exportOptionArray();
|
||||
$options['driver'] = 'workerman';
|
||||
$options['worker-num'] = 1;
|
||||
$options['private-mode'] = true;
|
||||
|
||||
// TODO: optimize this, maybe abstract the application (framework)
|
||||
$bootstrappers = new ReflectionProperty(\ZM\ConsoleApplication::class, 'bootstrappers');
|
||||
foreach ($bootstrappers->getDefaultValue() as $bootstrapper) {
|
||||
resolve($bootstrapper)->bootstrap($options);
|
||||
}
|
||||
|
||||
try {
|
||||
(new Framework($options))->init()->start();
|
||||
exit($_swoole_atomic->get());
|
||||
} catch (Throwable $e) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user