comparison vendor/pear/console_commandline/tests/console_commandline_bug18682.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 Test for bug #18682: columnWrap() in Default Renderer eats up lines with only a EOL.
3 --ARGS--
4 cmd1 --help 2>&1
5 --FILE--
6 <?php
7
8 require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'tests.inc.php';
9
10 class Renderer extends Console_CommandLine_Renderer_Default {
11 protected function description() {
12 return $this->columnWrap($this->parser->description, 2);
13 }
14 }
15
16 $parser = new Console_CommandLine();
17 $parser->accept(new Renderer);
18 $parser->renderer->line_width = 75;
19 $parser->addCommand('cmd1', array(
20 'description' => '
21 Installs listed packages.
22
23 local package.xml example:
24 php pyrus.phar install package.xml
25
26 local package archive example:
27 php pyrus.phar install PackageName-1.2.0.tar
28
29 remote package archive example:
30 php pyrus.phar install http://www.example.com/PackageName-1.2.0.tgz
31
32 Examples of an abstract package:
33 php pyrus.phar install PackageName
34 installs PackageName from the default channel with stability preferred_state
35 php pyrus.phar pear/PackageName
36 installs PackageName from the pear.php.net channel with stability preferred_state
37 php pyrus.phar install channel://doc.php.net/PackageName
38 installs PackageName from the doc.php.net channel with stability preferred_state
39 php pyrus.phar install PackageName-beta
40 installs PackageName from the default channel, beta or stable stability
41 php pyrus.phar install PackageName-1.2.0
42 installs PackageName from the default channel, version 1.2.0'
43 ));
44 $parser->parse();
45
46 ?>
47 --EXPECTF--
48 Installs listed packages.
49
50 local package.xml example:
51 php pyrus.phar install package.xml
52
53 local package archive example:
54 php pyrus.phar install PackageName-1.2.0.tar
55
56 remote package archive example:
57 php pyrus.phar install http://www.example.com/PackageName-1.2.0.tgz
58
59 Examples of an abstract package:
60 php pyrus.phar install PackageName
61 installs PackageName from the default channel with stability
62 preferred_state
63 php pyrus.phar pear/PackageName
64 installs PackageName from the pear.php.net channel with stability
65 preferred_state
66 php pyrus.phar install channel://doc.php.net/PackageName
67 installs PackageName from the doc.php.net channel with stability
68 preferred_state
69 php pyrus.phar install PackageName-beta
70 installs PackageName from the default channel, beta or stable stability
71 php pyrus.phar install PackageName-1.2.0
72 installs PackageName from the default channel, version 1.2.0
73
74 Usage:
75 %sconsole_commandline_bug18682.php
76 [options] cmd1 [options]
77
78 Options:
79 -h, --help show this help message and exit