fix tests

This commit is contained in:
sunxyw
2023-02-24 17:00:40 +08:00
parent bc76febadb
commit fa5b41c26d
3 changed files with 15 additions and 8 deletions

View File

@@ -57,11 +57,11 @@ $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);
}
$kernel = \ZM\Kernel::getInstance();
$kernel->setEnvironment('development');
$kernel->setTestMode(true);
$kernel->setConfigDir(dirname(__DIR__) . '/config');
$kernel->bootstrap();
try {
(new Framework($options))->init()->start();