1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- /*
- * This file is part of PHP CS Fixer.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- * Dariusz Rumiński <dariusz.ruminski@gmail.com>
- *
- * This source file is subject to the MIT license that is bundled
- * with this source code in the file LICENSE.
- */
- namespace PhpCsFixer\Tests\AutoReview;
- use PhpCsFixer\Console\Application;
- use PhpCsFixer\Console\Command\DescribeCommand;
- use PhpCsFixer\FixerFactory;
- use PhpCsFixer\Tests\TestCase;
- use Symfony\Component\Console\Tester\CommandTester;
- /**
- * @internal
- *
- * @coversNothing
- * @group auto-review
- * @group covers-nothing
- */
- final class DescribeCommandTest extends TestCase
- {
- /**
- * @dataProvider provideDescribeCommandCases
- *
- * @param FixerFactory $factory
- * @param string $fixerName
- */
- public function testDescribeCommand(FixerFactory $factory, $fixerName)
- {
- $command = new DescribeCommand($factory);
- $application = new Application();
- $application->add($command);
- $commandTester = new CommandTester($command);
- $commandTester->execute([
- 'command' => $command->getName(),
- 'name' => $fixerName,
- ]);
- static::assertSame(0, $commandTester->getStatusCode());
- }
- public function provideDescribeCommandCases()
- {
- $factory = new FixerFactory();
- $factory->registerBuiltInFixers();
- $cases = [];
- foreach ($factory->getFixers() as $fixer) {
- $cases[] = [$factory, $fixer->getName()];
- }
- return $cases;
- }
- }
|