* 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; /** * @covers \PhpCsFixer\Fixer\ClassNotation\OrderedTraitsFixer * * @internal * * @extends AbstractFixerTestCase<\PhpCsFixer\Fixer\ClassNotation\OrderedTraitsFixer> * * @phpstan-import-type _AutogeneratedInputConfiguration from \PhpCsFixer\Fixer\ClassNotation\OrderedTraitsFixer */ final class OrderedTraitsFixerTest extends AbstractFixerTestCase { /** * @dataProvider provideFixCases * * @param _AutogeneratedInputConfiguration $configuration */ public function testFix(string $expected, ?string $input = null, array $configuration = []): void { $this->fixer->configure($configuration); $this->doTest($expected, $input); } /** * @return iterable */ public static function provideFixCases(): iterable { yield 'simple' => [ ' [ ' [ ' [ ' [ ' [ ' [ ' [ ' [ ' [ ' [ \sprintf(" [ ' [ ' [ ' [ ' [ ' [ ' */ use A; /** @phpstan-use B */ use B; /** @phpstan-use C */ use C; }', ' */ use C; /** @phpstan-use B */ use B; // foo 1 /** @phpstan-use A */ use A; }', ]; yield 'simple and with namespace' => [ ' [ ' true, ], ]; } }