help_name.phpt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. --TEST--
  2. Single Application can be executed
  3. --ARGS--
  4. --help --no-ansi
  5. --FILE--
  6. <?php
  7. use Symfony\Component\Console\Input\InputInterface;
  8. use Symfony\Component\Console\Output\OutputInterface;
  9. use Symfony\Component\Console\SingleCommandApplication;
  10. $vendor = __DIR__;
  11. while (!file_exists($vendor.'/vendor')) {
  12. $vendor = dirname($vendor);
  13. }
  14. require $vendor.'/vendor/autoload.php';
  15. (new SingleCommandApplication())
  16. ->setName('My Super Command')
  17. ->setCode(function (InputInterface $input, OutputInterface $output): int {
  18. return 0;
  19. })
  20. ->run()
  21. ;
  22. ?>
  23. --EXPECTF--
  24. Usage:
  25. %s
  26. Options:
  27. -h, --help Display help for the given command. When no command is given display help for the %s command
  28. -q, --quiet Do not output any message
  29. -V, --version Display this application version
  30. --ansi|--no-ansi Force (or disable --no-ansi) ANSI output
  31. -n, --no-interaction Do not ask any interactive question
  32. -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug