PEAR2_Console_CommandLine-0.2.0PEAR2_Console_CommandLine-0.2.0/test/pear2.php.net/PEAR2_Console_CommandLine/console_commandline_parse_19.phpt

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
--TEST--
Test for PEAR2\Console\CommandLine::parse() method (subcommand help 1).
--STDIN--
some_package
--SKIPIF--
<?php if(php_sapi_name()!='cli') echo 'skip'; ?>
--ARGS--
-v instbis -f -
--FILE--
<?php

require_once __DIR__ . DIRECTORY_SEPARATOR . 'tests.inc.php';

$parser = buildParser2();
try {
    $result = $parser->parse();
    print_r($result);
} catch (PEAR2\Console\CommandLine\Exception $exc) {
    echo $exc->getMessage();
}

?>
--EXPECT--
PEAR2\Console\CommandLine\Result Object
(
    [options] => Array
        (
            [verbose] => 1
            [logfile] => 
            [help] => 
            [version] => 
        )

    [args] => Array
        (
        )

    [command_name] => install
    [command] => PEAR2\Console\CommandLine\Result Object
        (
            [options] => Array
                (
                    [force] => 1
                    [help] => 
                )

            [args] => Array
                (
                    [package] => some_package

                )

            [command_name] => 
            [command] => 
        )

)
EOF