* 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\Strict; use PhpCsFixer\Tests\Test\AbstractFixerTestCase; use PhpCsFixer\WhitespacesFixerConfig; /** * @internal * * @covers \PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer * * @extends AbstractFixerTestCase<\PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer> */ final class DeclareStrictTypesFixerTest extends AbstractFixerTestCase { /** * @dataProvider provideFixCases */ public function testFix(string $expected, ?string $input = null): void { $this->doTest($expected, $input); } /** * @return iterable */ public static function provideFixCases(): iterable { yield [ ' [ '', '', ]; yield 'monolithic file with closing tag and extra new line' => [ ''."\n", ''."\n", ]; yield 'monolithic file with closing tag and extra content' => [ 'Test', ]; yield [ ' [ '', ]; yield 'empty file /w open tag' => [ ' [ 'x', ]; yield 'non-empty file /w open tag' => [ 'x [ <<<'EOD' #!x [ <<<'EOD' #!x y EOD, ]; yield 'file with shebang not followed by open tag' => [ <<<'EOD' #!x #!not_a_shebang fixer->setWhitespacesConfig(new WhitespacesFixerConfig("\t", "\r\n")); $this->doTest($expected, $input); } /** * @return iterable */ public static function provideWithWhitespacesConfigCases(): iterable { yield [ "