8000 Dont run command if suggestion is only a namespace · symfony/symfony@1b9f9eb · GitHub
[go: up one dir, main page]

Skip to content

Commit 1b9f9eb

Browse files
committed
Dont run command if suggestion is only a namespace
1 parent e4deda7 commit 1b9f9eb

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,24 @@ public function testFindAlternativeExceptionMessageSingle($name)
459459
$application->find($name);
460460
}
461461

462+
public function testDontRunAlternativeNamespaceName()
463+
{
464+
$application = new Application();
465+
$application->add(new \Foo1Command());
466+
$application->setAutoExit(false);
467+
$tester = new ApplicationTester($application);
468+
$tester->run(array('command' => 'foos:bar1'), array('decorated' => false));
469+
$this->assertSame("
470+
471+
There are no commands defined in the \"foos\" namespace.
472+
473+
Did you mean this?
474+
foo
475+
476+
477+
", $tester->getDisplay(true));
478+
}
479+
462480
public function testCanRunAlternativeCommandName()
463481
{
464482
$application = new Application();

0 commit comments

Comments
 (0)
0