Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c750261

Browse filesBrowse files
committed
Make test aware of new commands
1 parent 67e3078 commit c750261
Copy full SHA for c750261

File tree

6 files changed

+546
-2
lines changed
Filter options

6 files changed

+546
-2
lines changed

‎src/Symfony/Component/Console/Command/CompleteCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Command/CompleteCommand.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct(LoggerInterface $logger = null)
4646
protected function configure(): void
4747
{
4848
$this
49-
->setName(self::$defaultName)
49+
->setName(ltrim(self::$defaultName, '|'))
5050
->setDescription(self::$defaultDescription)
5151
->setHidden(true)
5252
->addOption('shell', 's', InputOption::VALUE_REQUIRED)

‎src/Symfony/Component/Console/Tests/ApplicationTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/ApplicationTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function testConstructor()
106106
$application = new Application('foo', 'bar');
107107
$this->assertEquals('foo', $application->getName(), '__construct() takes the application name as its first argument');
108108
$this->assertEquals('bar', $application->getVersion(), '__construct() takes the application version as its second argument');
109-
$this->assertEquals(['help', 'list'], array_keys($application->all()), '__construct() registered the help and list commands by default');
109+
$this->assertEquals(['help', 'list', '_complete', 'completion'], array_keys($application->all()), '__construct() registered the help and list commands by default');
110110
}
111111

112112
public function testSetGetName()

‎src/Symfony/Component/Console/Tests/Fixtures/application_1.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/Fixtures/application_1.json
+191Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,194 @@
11
{
22
"commands": [
3+
{
4+
"name": "_complete",
5+
"hidden": true,
6+
"usage": [
7+
"_complete [-s|--shell SHELL] [-c|--current CURRENT] [-i|--input INPUT]"
8+
],
9+
"description": "Internal command to provide shell completion suggestions",
10+
"help": "Internal command to provide shell completion suggestions",
11+
"definition": {
12+
"arguments": [],
13+
"options": {
14+
"help": {
15+
"name": "--help",
16+
"shortcut": "-h",
17+
"accept_value": false,
18+
"is_value_required": false,
19+
"is_multiple": false,
20+
"description": "Display help for the given command. When no command is given display help for the <info>list</info> command",
21+
"default": false
22+
},
23+
"quiet": {
24+
"name": "--quiet",
25+
"shortcut": "-q",
26+
"accept_value": false,
27+
"is_value_required": false,
28+
"is_multiple": false,
29+
"description": "Do not output any message",
30+
"default": false
31+
},
32+
"verbose": {
33+
"name": "--verbose",
34+
"shortcut": "-v|-vv|-vvv",
35+
"accept_value": false,
36+
"is_value_required": false,
37+
"is_multiple": false,
38+
"description": "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug",
39+
"default": false
40+
},
41+
"version": {
42+
"name": "--version",
43+
"shortcut": "-V",
44+
"accept_value": false,
45+
"is_value_required": false,
46+
"is_multiple": false,
47+
"description": "Display this application version",
48+
"default": false
49+
},
50+
"ansi": {
51+
"name": "--ansi",
52+
"shortcut": "",
53+
"accept_value": false,
54+
"is_value_required": false,
55+
"is_multiple": false,
56+
"description": "Force (or disable --no-ansi) ANSI output",
57+
"default": false
58+
},
59+
"no-ansi": {
60+
"name": "--no-ansi",
61+
"shortcut": "",
62+
"accept_value": false,
63+
"is_value_required": false,
64+
"is_multiple": false,
65+
"description": "Negate the \"--ansi\" option",
66+
"default": false
67+
},
68+
"no-interaction": {
69+
"name": "--no-interaction",
70+
"shortcut": "-n",
71+
"accept_value": false,
72+
"is_value_required": false,
73+
"is_multiple": false,
74+
"description": "Do not ask any interactive question",
75+
"default": false
76+
},
77+
"shell": {
78+
"name": "--shell",
79+
"shortcut": "-s",
80+
"accept_value": true,
81+
"is_value_required": true,
82+
"is_multiple": false,
83+
"description": "",
84+
"default": false
85+
},
86+
"current": {
87+
"name": "--current",
88+
"shortcut": "-c",
89+
"accept_value": true,
90+
"is_value_required": true,
91+
"is_multiple": false,
92+
"description": "",
93+
"default": false
94+
},
95+
"input": {
96+
"name": "--input",
97+
"shortcut": "-i",
98+
"accept_value": true,
99+
"is_value_required": true,
100+
"is_multiple": true,
101+
"description": "",
102+
"default": []
103+
}
104+
}
105+
}
106+
},
107+
{
108+
"name": "completion",
109+
"hidden": true,
110+
"usage": [
111+
"completion [<shell>]"
112+
],
113+
"description": "",
114+
"help": "",
115+
"definition": {
116+
"arguments": {
117+
"shell": {
118+
"name": "shell",
119+
"is_required": false,
120+
"is_array": false,
121+
"description": "The shell type, the value of the \"$SHELL\" env var will be used if this is not given",
122+
"default": null
123+
}
124+
},
125+
"options": {
126+
"help": {
127+
"name": "--help",
128+
"shortcut": "-h",
129+
"accept_value": false,
130+
"is_value_required": false,
131+
"is_multiple": false,
132+
"description": "Display help for the given command. When no command is given display help for the <info>list</info> command",
133+
"default": false
134+
},
135+
"quiet": {
136+
"name": "--quiet",
137+
"shortcut": "-q",
138+
"accept_value": false,
139+
"is_value_required": false,
140+
"is_multiple": false,
141+
"description": "Do not output any message",
142+
"default": false
143+
},
144+
"verbose": {
145+
"name": "--verbose",
146+
"shortcut": "-v|-vv|-vvv",
147+
"accept_value": false,
148+
"is_value_required": false,
149+
"is_multiple": false,
150+
"description": "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug",
151+
"default": false
152+
},
153+
"version": {
154+
"name": "--version",
155+
"shortcut": "-V",
156+
"accept_value": false,
157+
"is_value_required": false,
158+
"is_multiple": false,
159+
"description": "Display this application version",
160+
"default": false
161+
},
162+
"ansi": {
163+
"name": "--ansi",
164+
"shortcut": "",
165+
"accept_value": false,
166+
"is_value_required": false,
167+
"is_multiple": false,
168+
"description": "Force (or disable --no-ansi) ANSI output",
169+
"default": false
170+
},
171+
"no-ansi": {
172+
"name": "--no-ansi",
173+
"shortcut": "",
174+
"accept_value": false,
175+
"is_value_required": false,
176+
"is_multiple": false,
177+
"description": "Negate the \"--ansi\" option",
178+
"default": false
179+
},
180+
"no-interaction": {
181+
"name": "--no-interaction",
182+
"shortcut": "-n",
183+
"accept_value": false,
184+
"is_value_required": false,
185+
"is_multiple": false,
186+
"description": "Do not ask any interactive question",
187+
"default": false
188+
}
189+
}
190+
}
191+
},
3192
{
4193
"name": "help",
5194
"hidden": false,
@@ -220,6 +409,8 @@
220409
{
221410
"id": "_global",
222411
"commands": [
412+
"_complete",
413+
"completion",
223414
"help",
224415
"list"
225416
]

‎src/Symfony/Component/Console/Tests/Fixtures/application_1.xml

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/Fixtures/application_1.xml
+81Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,85 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<symfony>
33
<commands>
4+
<command id="_complete" name="_complete" hidden="1">
5+
<usages>
6+
<usage>_complete [-s|--shell SHELL] [-c|--current CURRENT] [-i|--input INPUT]</usage>
7+
</usages>
8+
<description>Internal command to provide shell completion suggestions</description>
9+
<help>Internal command to provide shell completion suggestions</help>
10+
<arguments/>
11+
<options>
12+
<option name="--shell" shortcut="-s" accept_value="1" is_value_required="1" is_multiple="0">
13+
<description></description>
14+
<defaults/>
15+
</option>
16+
<option name="--current" shortcut="-c" accept_value="1" is_value_required="1" is_multiple="0">
17+
<description></description>
18+
<defaults/>
19+
</option>
20+
<option name="--input" shortcut="-i" accept_value="1" is_value_required="1" is_multiple="1">
21+
<description></description>
22+
<defaults/>
23+
</option>
24+
<option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
25+
<description>Display help for the given command. When no command is given display help for the &lt;info&gt;list&lt;/info&gt; command</description>
26+
</option>
27+
<option name="--quiet" shortcut="-q" accept_value="0" is_value_required="0" is_multiple="0">
28+
<description>Do not output any message</description>
29+
</option>
30+
<option name="--verbose" shortcut="-v" shortcuts="-v|-vv|-vvv" accept_value="0" is_value_required="0" is_multiple="0">
31+
<description>Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug</description>
32+
</option>
33+
<option name="--version" shortcut="-V" accept_value="0" is_value_required="0" is_multiple="0">
34+
<description>Display this application version</description>
35+
</option>
36+
<option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
37+
<description>Force (or disable --no-ansi) ANSI output</description>
38+
</option>
39+
<option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
40+
<description>Negate the "--ansi" option</description>
41+
</option>
42+
<option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
43+
<description>Do not ask any interactive question</description>
44+
</option>
45+
</options>
46+
</command>
47+
<command id="completion" name="completion" hidden="1">
48+
<usages>
49+
<usage>completion [&lt;shell&gt;]</usage>
50+
</usages>
51+
<description></description>
52+
<help></help>
53+
<arguments>
54+
<argument name="shell" is_required="0" is_array="0">
55+
<description>The shell type, the value of the "$SHELL" env var will be used if this is not given</description>
56+
<defaults/>
57+
</argument>
58+
</arguments>
59+
<options>
60+
<option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
61+
<description>Display help for the given command. When no command is given display help for the &lt;info&gt;list&lt;/info&gt; command</description>
62+
</option>
63+
<option name="--quiet" shortcut="-q" accept_value="0" is_value_required="0" is_multiple="0">
64+
<description>Do not output any message</description>
65+
</option>
66+
<option name="--verbose" shortcut="-v" shortcuts="-v|-vv|-vvv" accept_value="0" is_value_required="0" is_multiple="0">
67+
<description>Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug</description>
68+
</option>
69+
<option name="--version" shortcut="-V" accept_value="0" is_value_required="0" is_multiple="0">
70+
<description>Display this application version</description>
71+
</option>
72+
<option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
73+
<description>Force (or disable --no-ansi) ANSI output</description>
74+
</option>
75+
<option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
76+
<description>Negate the "--ansi" option</description>
77+
</option>
78+
<option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
79+
<description>Do not ask any interactive question</description>
80+
</option>
81+
</options>
82+
</command>
483
<command id="help" name="help" hidden="0">
584
<usages>
685
<usage>help [--format FORMAT] [--raw] [--] [&lt;command_name&gt;]</usage>
@@ -121,6 +200,8 @@
121200
</commands>
122201
<namespaces>
123202
<namespace id="_global">
203+
<command>_complete</command>
204+
<command>completion</command>
124205
<command>help</command>
125206
<command>list</command>
126207
</namespace>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.