use Symfony\Component\Console\Tester\CommandCompletionTester;
use Symfony\Component\DependencyInjection\ServiceLocator;
class WorkflowDumpCommandTest extends TestCase
{ /**
* @dataProvider provideCompletionSuggestions
*/
public function testComplete(array
$input, array
$expectedSuggestions) { $application =
new Application();
$application->
add(new WorkflowDumpCommand(new ServiceLocator([])));
$tester =
new CommandCompletionTester($application->
find('workflow:dump'
));
$suggestions =
$tester->
complete($input, 2
);
$this->
assertSame($expectedSuggestions,
$suggestions);
} public static function provideCompletionSuggestions(): iterable
{ yield 'option --dump-format' =>
[['--dump-format', ''
],
['puml', 'mermaid', 'dot'
]];
}}