* 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\Phpdoc; use PhpCsFixer\Tests\Test\AbstractFixerTestCase; /** * @author Graham Campbell * * @internal * * @covers \PhpCsFixer\Fixer\Phpdoc\NoBlankLinesAfterPhpdocFixer * * @extends AbstractFixerTestCase<\PhpCsFixer\Fixer\Phpdoc\NoBlankLinesAfterPhpdocFixer> */ final class NoBlankLinesAfterPhpdocFixerTest extends AbstractFixerTestCase { public function testSimpleExampleIsNotChanged(): void { $input = <<<'EOF' doTest($input); } public function testComplexExampleIsNotChanged(): void { $input = <<<'EOF' doTest($input); } public function testCommentsAreNotChanged(): void { $input = <<<'EOF' doTest($input); } public function testLineBeforeDeclareIsNotRemoved(): void { $expected = <<<'EOF' doTest($expected); } public function testLineBeforeUseStatementIsNotRemoved(): void { $expected = <<<'EOF' doTest($expected); } /** * @dataProvider provideLineBeforeIncludeOrRequireIsNotRemovedCases */ public function testLineBeforeIncludeOrRequireIsNotRemoved(string $expected, ?string $input = null): void { $this->doTest($expected, $input); } /** * @return iterable */ public static function provideLineBeforeIncludeOrRequireIsNotRemovedCases(): iterable { yield [ <<<'EOF' doTest( 'doTest( 'doTest($expected, $input); } public function testFixesIndentedClass(): void { $expected = <<<'EOF' doTest($expected, $input); } public function testFixesOthers(): void { $expected = <<<'EOF' doTest($expected, $input); } public function testWhitespaceInDocBlockAboveNamespaceIsNotTouched(): void { $expected = <<<'EOF' doTest($expected); } public function testFixesWindowsStyle(): void { $expected = "doTest($expected, $input); } /** * Empty line between typehinting docs and return statement should be preserved. * * @dataProvider provideInlineTypehintingDocsBeforeFlowBreakCases */ public function testInlineTypehintingDocsBeforeFlowBreak(string $expected, ?string $input = null): void { $this->doTest($expected, $input); } /** * @return iterable */ public static function provideInlineTypehintingDocsBeforeFlowBreakCases(): iterable { yield [ <<<'EOF' getDescription(); } } EOF, ]; yield [ <<<'EOF' getDescription()); } } EOF, ]; yield [ <<<'EOF'