* 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; /** * @author Graham Campbell * * @internal * * @covers \PhpCsFixer\AbstractPhpdocTypesFixer * @covers \PhpCsFixer\Fixer\Phpdoc\PhpdocScalarFixer * * @extends AbstractFixerTestCase<\PhpCsFixer\Fixer\Phpdoc\PhpdocScalarFixer> * * @phpstan-import-type _AutogeneratedInputConfiguration from \PhpCsFixer\Fixer\Phpdoc\PhpdocScalarFixer */ final class PhpdocScalarFixerTest 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 'basic fix' => [ ' [ ' [ ' [ " [ ' [ ' [ ' [ ' [ ' [ ' [ ' [ " [ ' [ ' [ ' [ ' ['boolean', 'callback', 'double', 'integer', 'real', 'str']], ]; yield 'fix Windows line endings' => [ str_replace("\n", "\r\n", ' */', ' */', ]; yield [ '