DumpCompletionCommandTest.php 991 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Console\Tests\Command;
  11. use PHPUnit\Framework\TestCase;
  12. use Symfony\Component\Console\Command\DumpCompletionCommand;
  13. use Symfony\Component\Console\Tester\CommandCompletionTester;
  14. class DumpCompletionCommandTest extends TestCase
  15. {
  16. /**
  17. * @dataProvider provideCompletionSuggestions
  18. */
  19. public function testComplete(array $input, array $expectedSuggestions)
  20. {
  21. $tester = new CommandCompletionTester(new DumpCompletionCommand());
  22. $suggestions = $tester->complete($input);
  23. $this->assertSame($expectedSuggestions, $suggestions);
  24. }
  25. public static function provideCompletionSuggestions()
  26. {
  27. yield 'shell' => [
  28. [''],
  29. ['bash'],
  30. ];
  31. }
  32. }