0
|
1 --TEST--
|
|
2 Test for Console_CommandLine::parse() method (password option).
|
|
3 --SKIPIF--
|
|
4 <?php if(php_sapi_name()!='cli') echo 'skip'; ?>
|
|
5 --ARGS--
|
|
6 -p -- foo bar
|
|
7 --STDIN--
|
|
8 secretpass
|
|
9 --FILE--
|
|
10 <?php
|
|
11
|
|
12 require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'tests.inc.php';
|
|
13
|
|
14 $parser = buildParser1();
|
|
15 $result = $parser->parse();
|
|
16 var_dump($result->options);
|
|
17 var_dump($result->args);
|
|
18
|
|
19 ?>
|
|
20 --EXPECTF--
|
|
21 Password%s array(11) {
|
|
22 ["true"]=>
|
|
23 NULL
|
|
24 ["false"]=>
|
|
25 NULL
|
|
26 ["int"]=>
|
|
27 int(1)
|
|
28 ["float"]=>
|
|
29 float(1)
|
|
30 ["string"]=>
|
|
31 NULL
|
|
32 ["counter"]=>
|
|
33 NULL
|
|
34 ["callback"]=>
|
|
35 NULL
|
|
36 ["array"]=>
|
|
37 array(2) {
|
|
38 [0]=>
|
|
39 string(4) "spam"
|
|
40 [1]=>
|
|
41 string(3) "egg"
|
|
42 }
|
|
43 ["password"]=>
|
|
44 string(10) "secretpass"
|
|
45 ["help"]=>
|
|
46 NULL
|
|
47 ["version"]=>
|
|
48 NULL
|
|
49 }
|
|
50 array(2) {
|
|
51 ["simple"]=>
|
|
52 string(3) "foo"
|
|
53 ["multiple"]=>
|
|
54 array(1) {
|
|
55 [0]=>
|
|
56 string(3) "bar"
|
|
57 }
|
|
58 }
|