* 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\ClassNotation; use PhpCsFixer\Tests\Test\AbstractFixerTestCase; /** * @author Filippo Tessarotto * * @internal * * @covers \PhpCsFixer\Fixer\ClassNotation\FinalPublicMethodForAbstractClassFixer * * @extends AbstractFixerTestCase<\PhpCsFixer\Fixer\ClassNotation\FinalPublicMethodForAbstractClassFixer> */ final class FinalPublicMethodForAbstractClassFixerTest extends AbstractFixerTestCase { /** * @param string $expected PHP source code * @param null|string $input PHP source code * * @dataProvider provideFixCases */ public function testFix(string $expected, ?string $input = null): void { $this->doTest($expected, $input); } /** * @return iterable */ public static function provideFixCases(): iterable { $original = $fixed = self::getClassElementStubs(); $fixed = str_replace('public function f1', 'final public function f1', $fixed); $fixed = str_replace('public static function f4', 'final public static function f4', $fixed); $fixed = str_replace('static public function f7', 'final static public function f7', $fixed); yield 'regular-class' => [" [" [" [ ' [ ' [ ' [ ' [ " [ ' [ \sprintf( ' [ 'doTest($expected, $input); } /** * @return iterable */ public static function provideFix82Cases(): iterable { yield 'abstract keyword after readonly/public keywords' => [ ' [ ' [ ' [ '