bug11068.phpt 793 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --TEST--
  2. Console_Getopt [bug 11068]
  3. --SKIPIF--
  4. --FILE--
  5. <?php
  6. $_SERVER['argv'] =
  7. $argv = array('hi', '-fjjohnston@mail.com', '--to', 'hi', '-');
  8. require_once 'Console/Getopt.php';
  9. $ret = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), 'f:t:',
  10. array('from=','to=','mailpack=','direction=','verbose','debug'));
  11. if(PEAR::isError($ret))
  12. {
  13. echo $ret->getMessage()."\n";
  14. echo 'FATAL';
  15. exit;
  16. }
  17. print_r($ret);
  18. ?>
  19. --EXPECT--
  20. Array
  21. (
  22. [0] => Array
  23. (
  24. [0] => Array
  25. (
  26. [0] => f
  27. [1] => jjohnston@mail.com
  28. )
  29. [1] => Array
  30. (
  31. [0] => --to
  32. [1] => hi
  33. )
  34. )
  35. [1] => Array
  36. (
  37. [0] => -
  38. )
  39. )