8000 fixed previous commit · symfony/symfony@abbb25f · GitHub
[go: up one dir, main page]

Skip to content

Commit abbb25f

Browse files
committed
fixed previous commit
1 parent 70f2b3e commit abbb25f

File tree

2 files changed

+30
-15
lines changed

2 files changed

+30
-15
lines changed

src/Symfony/Component/Console/Tests/Command/ListCommandTest.php

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function testExecuteListsCommandsWithNamespaceArgument()
6262
$this->assertEquals($output, $commandTester->getDisplay(true));
6363
}
6464

65-
public function testExecuteListsCommandsNameAndNamespaceRaw()
65+
public function testExecuteListsCommandsOrder()
6666
{
6767
require_once realpath(__DIR__.'/../Fixtures/Foo6Command.php');
6868
$application = new Application();
@@ -73,22 +73,38 @@ public function testExecuteListsCommandsNameAndNamespaceRaw()
7373
Console Tool
7474
7575
Usage:
76-
[options] command [arguments]
76+
command [options] [arguments]
7777
7878
Options:
79-
--help (-h) Display this help message.
80-
--quiet (-q) Do not output any message.
81-
--verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.
82-
--version (-V) Display this application version.
83-
--ansi Force ANSI output.
84-
--no-ansi Disable ANSI output.
85-
--no-interaction (-n) Do not ask any interactive question.
79+
--help -h Display this help message
80+
--quiet -q Do not output any message
81+
--verbose -v|vv|vvv Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
82+
--version -V Display this application version
83+
--ansi Force ANSI output
84+
--no-ansi Disable ANSI output
85+
--no-interaction -n Do not ask any interactive question
8686
8787
Available commands:
88-
help Displays help for a command
89-
list Lists commands
90-
<fg=blue>foo
91-
<fg=blue>foo:bar</fg=blue>
88+
help Displays help for a command
89+
list Lists commands
90+
0foo
91+
0foo:bar 0foo:bar command
92+
EOF;
93+
94+
$this->assertEquals($output, trim($commandTester->getDisplay(true)));
95+
}
96+
97+
public function testExecuteListsCommandsOrderRaw()
98+
{
99+
require_once realpath(__DIR__.'/../Fixtures/Foo6Command.php');
100+
$application = new Application();
101+
$application->add(new \Foo6Command());
102+
$commandTester = new CommandTester($command = $application->get('list'));
103+
$commandTester->execute(array('command' => $command->getName(), '--raw' => true));
104+
$output = <<<EOF
105+
help Displays help for a command
106+
list Lists commands
107+
0foo:bar 0foo:bar command
92108
EOF;
93109

94110
$this->assertEquals($output, trim($commandTester->getDisplay(true)));

src/Symfony/Component/Console/Tests/Fixtures/Foo6Command.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ class Foo6Command extends Command
77
{
88
protected function configure()
99
{
10-
$this->setName('<fg=blue>foo:bar</fg=blue>');
10+
$this->setName('0foo:bar')->setDescription('0foo:bar command');
1111
}
12-
1312
}

0 commit comments

Comments
 (0)
0