* 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 */ 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 testLineBeforeDeclareIsNotBeRemoved(): void { $expected = <<<'EOF' doTest($expected); } public function testLineBeforeUseStatementIsNotRemoved(): void { $expected = <<<'EOF' doTest($expected); } public function testLineWithSpacesIsRemovedWhenNextTokenIsIndented(): void { $this->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); } public static function provideInlineTypehintingDocsBeforeFlowBreakCases(): array { $cases = []; $cases[] = [<<<'EOF' getDescription(); } } EOF ]; $cases[] = [<<<'EOF' getDescription()); } } EOF ]; $cases[] = [<<<'EOF'