@@ -102,9 +102,10 @@ public function testCompleteCommandName(array $input, array $suggestions)
102102
103103 public function provideCompleteCommandNameInputs ()
104104 {
105- yield 'empty ' => [['bin/console ' ], ['help ' , 'list ' , 'completion ' , 'hello ' ]];
106- yield 'partial ' => [['bin/console ' , 'he ' ], ['help ' , 'list ' , 'completion ' , 'hello ' ]];
107- yield 'complete-shortcut-name ' => [['bin/console ' , 'hell ' ], ['hello ' ]];
105+ yield 'empty ' => [['bin/console ' ], ['help ' , 'list ' , 'completion ' , 'hello ' , 'ahoy ' ]];
106+ yield 'partial ' => [['bin/console ' , 'he ' ], ['help ' , 'list ' , 'completion ' , 'hello ' , 'ahoy ' ]];
107+ yield 'complete-shortcut-name ' => [['bin/console ' , 'hell ' ], ['hello ' , 'ahoy ' ]];
108+ yield 'complete-aliases ' => [['bin/console ' , 'ah ' ], ['hello ' , 'ahoy ' ]];
108109 }
109110
110111 /**
@@ -120,6 +121,8 @@ public function provideCompleteCommandInputDefinitionInputs()
120121 {
121122 yield 'definition ' => [['bin/console ' , 'hello ' , '- ' ], ['--help ' , '--quiet ' , '--verbose ' , '--version ' , '--ansi ' , '--no-interaction ' ]];
122123 yield 'custom ' => [['bin/console ' , 'hello ' ], ['Fabien ' , 'Robin ' , 'Wouter ' ]];
124+ yield 'definition-aliased ' => [['bin/console ' , 'ahoy ' , '- ' ], ['--help ' , '--quiet ' , '--verbose ' , '--version ' , '--ansi ' , '--no-interaction ' ]];
125+ yield 'custom-aliased ' => [['bin/console ' , 'ahoy ' ], ['Fabien ' , 'Robin ' , 'Wouter ' ]];
123126 }
124127
125128 private function execute (array $ input )
@@ -134,6 +137,7 @@ class CompleteCommandTest_HelloCommand extends Command
134137 public function configure (): void
135138 {
136139 $ this ->setName ('hello ' )
140+ ->setAliases (['ahoy ' ])
137141 ->addArgument ('name ' , InputArgument::REQUIRED )
138142 ;
139143 }
0 commit comments