Mercurial > hg > rc1
comparison vendor/pear/console_getopt/tests/bug13140.phpt @ 0:1e000243b222
vanilla 1.3.3 distro, I hope
author | Charlie Root |
---|---|
date | Thu, 04 Jan 2018 15:50:29 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:1e000243b222 |
---|---|
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 | |
9 require_once 'Console/Getopt.php'; | |
10 $cg = new Console_GetOpt(); | |
11 | |
12 print_r($cg->getopt2($cg->readPHPArgv(), 't', array('test'), true)); | |
13 print_r($cg->getopt2($cg->readPHPArgv(), 'bar', array('foo'), true)); | |
14 ?> | |
15 --EXPECT-- | |
16 Array | |
17 ( | |
18 [0] => Array | |
19 ( | |
20 [0] => Array | |
21 ( | |
22 [0] => --test | |
23 [1] => | |
24 ) | |
25 | |
26 ) | |
27 | |
28 [1] => Array | |
29 ( | |
30 [0] => thisshouldbehere | |
31 ) | |
32 | |
33 ) | |
34 Array | |
35 ( | |
36 [0] => Array | |
37 ( | |
38 [0] => Array | |
39 ( | |
40 [0] => --foo | |
41 [1] => | |
42 ) | |
43 | |
44 [1] => Array | |
45 ( | |
46 [0] => b | |
47 [1] => | |
48 ) | |
49 | |
50 [2] => Array | |
51 ( | |
52 [0] => a | |
53 [1] => | |
54 ) | |
55 | |
56 [3] => Array | |
57 ( | |
58 [0] => r | |
59 [1] => | |
60 ) | |
61 | |
62 [4] => Array | |
63 ( | |
64 [0] => r | |
65 [1] => | |
66 ) | |
67 | |
68 ) | |
69 | |
70 [1] => Array | |
71 ( | |
72 [0] => thisshouldbehere | |
73 ) | |
74 | |
75 ) |