TestSkinSystemCommand.php 963 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace App\Module\Game\Commands;
  3. use App\Module\Game\Tests\SkinSystemTest;
  4. use Illuminate\Console\Command;
  5. /**
  6. * 皮肤系统测试命令
  7. */
  8. class TestSkinSystemCommand extends Command
  9. {
  10. /**
  11. * 命令签名
  12. *
  13. * @var string
  14. */
  15. protected $signature = 'game:test-skin-system {--user-id=1 : 测试用户ID}';
  16. /**
  17. * 命令描述
  18. *
  19. * @var string
  20. */
  21. protected $description = '测试皮肤系统功能';
  22. /**
  23. * 执行命令
  24. *
  25. * @return int
  26. */
  27. public function handle(): int
  28. {
  29. $this->info('开始测试皮肤系统...');
  30. try {
  31. $test = new SkinSystemTest();
  32. $test->runAllTests();
  33. $this->info('皮肤系统测试完成!');
  34. return 0;
  35. } catch (\Exception $e) {
  36. $this->error('测试过程中发生错误: ' . $e->getMessage());
  37. return 1;
  38. }
  39. }
  40. }