* 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\ControlStructure; use PhpCsFixer\Tests\Test\AbstractFixerTestCase; /** * @author Sullivan Senechal * * @internal * * @covers \PhpCsFixer\Fixer\ControlStructure\SwitchCaseSpaceFixer * * @extends AbstractFixerTestCase<\PhpCsFixer\Fixer\ControlStructure\SwitchCaseSpaceFixer> */ final class SwitchCaseSpaceFixerTest extends AbstractFixerTestCase { /** * @dataProvider provideFixCases */ public function testFix(string $expected, ?string $input = null): void { $this->doTest($expected, $input); } public static function provideFixCases(): iterable { yield [ ' ', ]; yield [ ' ', ]; yield [ 'doTest($expected, $input); } /** * @return iterable */ public static function provideFixPre80Cases(): iterable { yield [ 'doTest($expected, $input); } /** * @return iterable */ public static function provideFix80Cases(): iterable { yield [ ' "a", default => "b" }; match ($bar) { 2 => "c", default=> "d" }; match ($baz) { 3 => "e", default => "f" }; ', ]; yield [ ' \'bronze\', default => null, } : null; };', ]; } /** * @dataProvider provideFix81Cases * * @requires PHP 8.1 */ public function testFix81(string $expected, ?string $input = null): void { $this->doTest($expected, $input); } /** * @return iterable */ public static function provideFix81Cases(): iterable { yield 'enums' => [ '