* 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; /** * @author Filippo Tessarotto * * @internal * * @covers \PhpCsFixer\Fixer\PhpUnit\PhpUnitMethodCasingFixer * * @extends AbstractFixerTestCase<\PhpCsFixer\Fixer\PhpUnit\PhpUnitMethodCasingFixer> * * @phpstan-import-type _AutogeneratedInputConfiguration from \PhpCsFixer\Fixer\PhpUnit\PhpUnitMethodCasingFixer */ final class PhpUnitMethodCasingFixerTest 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 'skip non phpunit methods' => [ ' [ ' [$camelCase, $snakeCase]) { yield $key.' to camel case' => [$camelCase, $snakeCase]; yield $key.' to snake case' => [$snakeCase, $camelCase, ['case' => 'snake_case']]; } yield 'mixed case to camel case' => [ ' [ ' 'snake_case'], ]; } /** * @dataProvider provideFix80Cases * * @requires PHP 8.0 */ public function testFix80(string $expected, string $input): void { $this->doTest($expected, $input); } /** * @return iterable */ public static function provideFix80Cases(): iterable { yield '@depends annotation with class name in Snake_Case' => [ ' [ ' */ private static function pairs(): iterable { yield 'default sample' => [ ' [ ' [ ' [ ' [ ' [ '