* Dariusz RumiƄski * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Fixer\PhpUnit; use PhpCsFixer\Tests\Test\AbstractFixerTestCase; /** * @internal * * @author Gert de Pagter * * @covers \PhpCsFixer\Fixer\PhpUnit\PhpUnitInternalClassFixer * * @extends AbstractFixerTestCase<\PhpCsFixer\Fixer\PhpUnit\PhpUnitInternalClassFixer> * * @phpstan-import-type _AutogeneratedInputConfiguration from \PhpCsFixer\Fixer\PhpUnit\PhpUnitInternalClassFixer */ final class PhpUnitInternalClassFixerTest extends AbstractFixerTestCase { /** * @param _AutogeneratedInputConfiguration $config * * @dataProvider provideFixCases */ public function testFix(string $expected, ?string $input = null, array $config = []): void { $this->fixer->configure($config); $this->doTest($expected, $input); } public static function provideFixCases(): iterable { yield 'It does not change normal classes' => [ ' [ ' [ ' [ ' [ ' [ ' [ ' [ ' [ ' [ ' [ ' [ ' [ ' ['abstract'], ], ]; yield 'If final is not added as an option, final classes will not be marked internal' => [ ' ['abstract'], ], ]; yield 'If normal is not added as an option, normal classes will not be marked internal' => [ ' ['abstract'], ], ]; yield 'It works correctly with multiple classes in one file, even when one of them is not allowed' => [ 'doTest($expected, $input); } /** * @return iterable */ public static function provideFix80Cases(): iterable { yield 'it adds a docblock above when there is an attribute' => [ ' [ ' [ ' [ 'fixer->configure($config); $this->doTest($expected, $input); } /** * @return iterable}> */ public static function provideFix82Cases(): iterable { yield 'If final is not added as an option, final classes will not be marked internal' => [ ' ['normal'], ], ]; yield [ '