DumpCompletionCommand example

use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Command\DumpCompletionCommand;
use Symfony\Component\Console\Tester\CommandCompletionTester;

class DumpCompletionCommandTest extends TestCase
{
    /** * @dataProvider provideCompletionSuggestions */
    public function testComplete(array $input, array $expectedSuggestions)
    {
        $tester = new CommandCompletionTester(new DumpCompletionCommand());
        $suggestions = $tester->complete($input);

        $this->assertSame($expectedSuggestions$suggestions);
    }

    public static function provideCompletionSuggestions()
    {
        yield 'shell' => [
            [''],
            ['bash', 'fish', 'zsh'],
        ];
    }
new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question'),
        ]);
    }

    /** * Gets the default commands that should always be available. * * @return Command[] */
    protected function getDefaultCommands(): array
    {
        return [new HelpCommand()new ListCommand()new CompleteCommand()new DumpCompletionCommand()];
    }

    /** * Gets the default helper set with the helpers that should always be available. */
    protected function getDefaultHelperSet(): HelperSet
    {
        return new HelperSet([
            new FormatterHelper(),
            new DebugFormatterHelper(),
            new ProcessHelper(),
            
new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question'),
        ]);
    }

    /** * Gets the default commands that should always be available. * * @return Command[] */
    protected function getDefaultCommands(): array
    {
        return [new HelpCommand()new ListCommand()new CompleteCommand()new DumpCompletionCommand()];
    }

    /** * Gets the default helper set with the helpers that should always be available. */
    protected function getDefaultHelperSet(): HelperSet
    {
        return new HelperSet([
            new FormatterHelper(),
            new DebugFormatterHelper(),
            new ProcessHelper(),
            
Home | Imprint | This part of the site doesn't use cookies.