bug13140.phpt 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. --TEST--
  2. Console_Getopt [bug 13140]
  3. --SKIPIF--
  4. --FILE--
  5. <?php
  6. $_SERVER['argv'] = $argv =
  7. array('--bob', '--foo' , '-bar', '--test', '-rq', 'thisshouldbehere');
  8. require_once 'Console/Getopt.php';
  9. $cg = new Console_GetOpt();
  10. print_r($cg->getopt2($cg->readPHPArgv(), 't', array('test'), true));
  11. print_r($cg->getopt2($cg->readPHPArgv(), 'bar', array('foo'), true));
  12. ?>
  13. --EXPECT--
  14. Array
  15. (
  16. [0] => Array
  17. (
  18. [0] => Array
  19. (
  20. [0] => --test
  21. [1] =>
  22. )
  23. )
  24. [1] => Array
  25. (
  26. [0] => thisshouldbehere
  27. )
  28. )
  29. Array
  30. (
  31. [0] => Array
  32. (
  33. [0] => Array
  34. (
  35. [0] => --foo
  36. [1] =>
  37. )
  38. [1] => Array
  39. (
  40. [0] => b
  41. [1] =>
  42. )
  43. [2] => Array
  44. (
  45. [0] => a
  46. [1] =>
  47. )
  48. [3] => Array
  49. (
  50. [0] => r
  51. [1] =>
  52. )
  53. [4] => Array
  54. (
  55. [0] => r
  56. [1] =>
  57. )
  58. )
  59. [1] => Array
  60. (
  61. [0] => thisshouldbehere
  62. )
  63. )