* 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\Comment; use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException; use PhpCsFixer\Tests\Test\AbstractFixerTestCase; /** * @author Filippo Tessarotto * * @internal * * @covers \PhpCsFixer\Fixer\Comment\SingleLineCommentStyleFixer * * @extends AbstractFixerTestCase<\PhpCsFixer\Fixer\Comment\SingleLineCommentStyleFixer> * * @phpstan-import-type _AutogeneratedInputConfiguration from \PhpCsFixer\Fixer\Comment\SingleLineCommentStyleFixer */ final class SingleLineCommentStyleFixerTest extends AbstractFixerTestCase { public function testInvalidConfig(): void { $this->expectException(InvalidFixerConfigurationException::class); $this->fixer->configure(['abc']); } /** * @dataProvider provideAsteriskCases */ public function testAsterisk(string $expected, ?string $input = null): void { $this->fixer->configure(['comment_types' => ['asterisk']]); $this->doTest($expected, $input); } /** * @return iterable */ public static function provideAsteriskCases(): iterable { yield [ ' [ 'fixer->configure(['comment_types' => ['hash']]); $this->doTest($expected, $input); } /** * @return iterable */ public static function provideHashCases(): iterable { yield [ '

This is an example

', '

This is an example

', ]; yield [ 'doTest($expected, $input); } /** * @return iterable */ public static function provideAllCases(): iterable { yield [ ' */ return "bar"; }', ]; } }