* 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\Tokenizer\Transformer; use PhpCsFixer\Tests\Test\AbstractTransformerTestCase; use PhpCsFixer\Tokenizer\CT; /** * @author Gregor Harlan * * @internal * * @covers \PhpCsFixer\Tokenizer\Transformer\ImportTransformer * * @phpstan-import-type _TransformerTestExpectedTokens from AbstractTransformerTestCase */ final class ImportTransformerTest extends AbstractTransformerTestCase { /** * @param _TransformerTestExpectedTokens $expectedTokens * * @dataProvider provideProcessCases */ public function testProcess(string $source, array $expectedTokens = []): void { $this->doTest( $source, $expectedTokens, [ T_CONST, CT::T_CONST_IMPORT, T_FUNCTION, CT::T_FUNCTION_IMPORT, ] ); } public static function provideProcessCases(): iterable { yield [ ' T_CONST, ], ]; yield [ ' T_CONST, ], ]; yield [ ' T_CONST, ], ]; yield [ ' CT::T_CONST_IMPORT, ], ]; yield [ ' T_FUNCTION, ], ]; yield [ ' T_FUNCTION, ], ]; yield [ ' T_FUNCTION, ], ]; yield [ ' T_FUNCTION, ], ]; yield [ ' CT::T_FUNCTION_IMPORT, ], ]; yield [ ' CT::T_FUNCTION_IMPORT, ], ]; yield [ ' CT::T_FUNCTION_IMPORT, 13 => CT::T_CONST_IMPORT, 20 => CT::T_FUNCTION_IMPORT, 27 => CT::T_CONST_IMPORT, 32 => CT::T_FUNCTION_IMPORT, 37 => CT::T_CONST_IMPORT, ], ]; } }