* 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\Phpdoc; use PhpCsFixer\Tests\Test\AbstractFixerTestCase; /** * @internal * * @author Gert de Pagter * * @covers \PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocAnnotationRemoveFixer * * @extends AbstractFixerTestCase<\PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocAnnotationRemoveFixer> * * @phpstan-import-type _AutogeneratedInputConfiguration from \PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocAnnotationRemoveFixer */ final class GeneralPhpdocAnnotationRemoveFixerTest 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 'An Annotation gets removed' => [ ' ['param']], ]; yield 'It removes multiple annotations' => [ ' ['param', 'return', 'throws']], ]; yield 'It does nothing if no configuration is given' => [ ' [ ' ['author', 'return', 'internal']], ]; yield 'Nothing happens to non doc-block comments' => [ ' ['internal', 'param', 'return']], ]; yield 'Nothing happens if to be deleted annotations are not present' => [ ' ['author', 'test', 'return', 'deprecated']], ]; yield [ ' ['noinspection']], ]; yield [ ' ['author'], 'case_sensitive' => true], ]; yield [ ' ['author'], 'case_sensitive' => false], ]; } }