[Console] Fixed tests about message exception when command is not available

This commit is contained in:
Grégoire Pineau 2012-08-07 16:16:59 +02:00
parent a4d2d31a9d
commit 039264d2d2
1 changed files with 11 additions and 2 deletions

View File

@ -496,7 +496,12 @@ class Application
}
if ($alternatives = $this->findAlternativeNamespace($part, $abbrevs)) {
$message .= "\n\nDid you mean one of these?\n ";
if (1 == count($alternatives)) {
$message .= "\n\nDid you mean this?\n ";
} else {
$message .= "\n\nDid you mean one of these?\n ";
}
$message .= implode("\n ", $alternatives);
}
@ -571,7 +576,11 @@ class Application
$message = sprintf('Command "%s" is not defined.', $name);
if ($alternatives = $this->findAlternativeCommands($searchName, $abbrevs)) {
$message .= "\n\nDid you mean one of these?\n ";
if (1 == count($alternatives)) {
$message .= "\n\nDid you mean this?\n ";
} else {
$message .= "\n\nDid you mean one of these?\n ";
}
$message .= implode("\n ", $alternatives);
}