$this->
assertStringContainsString('list [--raw] [--format FORMAT] [--short] [--] [<namespace>]',
$commandTester->
getDisplay(), '->execute() returns a text help for the given command'
);
$this->
assertStringContainsString('<command',
$commandTester->
getDisplay(), '->execute() returns an XML help text if --format=xml is passed'
);
} /**
* @dataProvider provideCompletionSuggestions
*/
public function testComplete(array
$input, array
$expectedSuggestions) { require_once realpath(__DIR__.'/../Fixtures/FooCommand.php'
);
$application =
new Application();
$application->
add(new \
FooCommand());
$tester =
new CommandCompletionTester($application->
get('help'
));
$suggestions =
$tester->
complete($input, 2
);
$this->
assertSame($expectedSuggestions,
$suggestions);
} public static function provideCompletionSuggestions() { yield 'option --format' =>
[ ['--format', ''
],
['txt', 'xml', 'json', 'md', 'rst'
],
];