* 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 */ final class OrderedTraitsFixerTest 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 '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' => [ ' $configuration * * @dataProvider provideFixWithConfigurationCases */ public function testFixWithConfiguration(array $configuration, string $expected, ?string $input = null): void { $this->fixer->configure($configuration); $this->doTest($expected, $input); } /** * @return iterable */ public static function provideFixWithConfigurationCases(): iterable { yield 'with case sensitive order' => [ [ 'case_sensitive' => true, ], '