co-phpunit 713 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env php
  2. <?php
  3. use EasySwoole\Command\CommandManager;
  4. use EasySwoole\Phpunit\PhpunitCommand;
  5. $file = null;
  6. foreach ([__DIR__ . '/../../../autoload.php', __DIR__ . '/../vendor/autoload.php'] as $file) {
  7. if (file_exists($file)) {
  8. require $file;
  9. break;
  10. }
  11. }
  12. if (!file_exists($file)) {
  13. die("include composer autoload.php fail\n");
  14. }
  15. $command = new PhpunitCommand();
  16. CommandManager::getInstance()->addCommand($command);
  17. array_splice($argv, 1, 0, $command->commandName());
  18. $caller = new \EasySwoole\Command\Caller();
  19. $caller->setScript(current($argv));
  20. $caller->setCommand(next($argv));
  21. $caller->setParams($argv);
  22. reset($argv);
  23. echo CommandManager::getInstance()->run($caller);