* 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\AttributeNotation; use PhpCsFixer\Tests\Test\AbstractFixerTestCase; /** * @author HypeMC * * @internal * * @covers \PhpCsFixer\Fixer\AttributeNotation\AttributeEmptyParenthesesFixer * * @requires PHP 8.0 * * @extends AbstractFixerTestCase<\PhpCsFixer\Fixer\AttributeNotation\AttributeEmptyParenthesesFixer> * * @phpstan-import-type _AutogeneratedInputConfiguration from \PhpCsFixer\Fixer\AttributeNotation\AttributeEmptyParenthesesFixer */ final class AttributeEmptyParenthesesFixerTest extends AbstractFixerTestCase { /** * @param _AutogeneratedInputConfiguration $configuration * * @dataProvider provideFixCases */ public function testFix(string $expected, ?string $input = null, array $configuration = []): void { $this->fixer->configure($configuration); $this->doTest($expected, $input); } public static function provideFixCases(): iterable { yield 'Without parentheses on various declarations' => [ ' null; ', ' null; ', ]; yield 'With parentheses on various declarations' => [ ' null; ', ' null; ', ['use_parentheses' => true], ]; } /** * @param _AutogeneratedInputConfiguration $configuration * * @dataProvider provideFix81Cases * * @requires PHP 8.1 */ public function testFix81(string $expected, ?string $input = null, array $configuration = []): void { $this->fixer->configure($configuration); $this->doTest($expected, $input); } public static function provideFix81Cases(): iterable { yield 'Without parentheses' => [ ' [ ' true], ]; } }