add CommandInfoUtil tests

This commit is contained in:
sunxyw
2022-05-03 16:57:57 +08:00
parent dab91f526e
commit e7f36b9fcf
2 changed files with 71 additions and 12 deletions

View File

@@ -9,7 +9,6 @@ use Throwable;
use ZM\Annotation\CQ\CQCommand;
use ZM\API\CQ;
use ZM\Event\EventManager;
use ZM\Utils\CommandInfoUtil;
use ZM\Utils\DataProvider;
use ZM\Utils\MessageUtil;
@@ -45,17 +44,6 @@ class MessageUtilTest extends TestCase
];
}
public function testGenerateCommandHelp(): void
{
EventManager::$events[CQCommand::class] = [];
$cmd = new CQCommand('测试命令');
$cmd->class = self::class;
$cmd->method = __FUNCTION__;
EventManager::addEvent(CQCommand::class, $cmd);
$help = resolve(CommandInfoUtil::class)->getHelp(self::class . '@' . __FUNCTION__, true);
$this->assertEquals('测试命令:作者很懒,啥也没说', $help);
}
/**
* @dataProvider providerTestArrayToStr
*/