* 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 */ final class SingleLineCommentStyleFixerTest extends AbstractFixerTestCase { public function testInvalidConfig(): void { $this->expectException(InvalidFixerConfigurationException::class); // @phpstan-ignore-next-line $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); } public static function provideAsteriskCases(): iterable { yield [ ' [ 'fixer->configure(['comment_types' => ['hash']]); $this->doTest($expected, $input); } public static function provideHashCases(): iterable { yield [ '

This is an example

', '

This is an example

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