|
0
|
1 --TEST--
|
|
|
2 Test for Console_CommandLine::addCommand() method.
|
|
|
3 --ARGS--
|
|
|
4 --FILE--
|
|
|
5 <?php
|
|
|
6
|
|
|
7 require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'tests.inc.php';
|
|
|
8
|
|
|
9 $parser = new Console_CommandLine(array('subcommand_required' => true));
|
|
|
10 $parser->addCommand('cmd1');
|
|
|
11 $parser->addCommand('cmd2');
|
|
|
12 $parser->addCommand('cmd3');
|
|
|
13 try {
|
|
|
14 $parser->parse();
|
|
|
15 } catch (Console_CommandLine_Exception $exc) {
|
|
|
16 echo $exc->getMessage();
|
|
|
17 }
|
|
|
18
|
|
|
19 ?>
|
|
|
20 --EXPECTF--
|
|
|
21 Please enter one of the following command: cmd1, cmd2, cmd3.
|