1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Merge pull request #9156 from vimeo/indent-docblocks-in-tests

Indent docblocks in DocComment test
This commit is contained in:
orklah 2023-01-21 00:09:43 +01:00 committed by GitHub
commit 9e34de59cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,17 +36,19 @@ class DocCommentTest extends BaseTestCase
],
);
$expectedDoc = '/**
* some desc
*
* @param string $bli
* @param int $bla
*
* @throws \Exception
*
* @return bool
*/
';
$expectedDoc = <<<'PHP'
/**
* some desc
*
* @param string $bli
* @param int $bla
*
* @throws \Exception
*
* @return bool
*/
PHP;
$this->assertSame($expectedDoc, $docComment->render(''));
}
@ -74,15 +76,17 @@ class DocCommentTest extends BaseTestCase
],
);
$expectedDoc = '/**
* some desc
*
* @param string $bli
* @param int $bla
* @throws \Exception
* @return bool
*/
';
$expectedDoc = <<<'PHP'
/**
* some desc
*
* @param string $bli
* @param int $bla
* @throws \Exception
* @return bool
*/
PHP;
$this->assertSame($expectedDoc, $docComment->render(''));
}
@ -110,17 +114,19 @@ class DocCommentTest extends BaseTestCase
],
);
$expectedDoc = '/**
* some desc
*
* @param string $bli
* @param int $bla
*
* @throws \Exception
*
* @return bool
*/
';
$expectedDoc = <<<'PHP'
/**
* some desc
*
* @param string $bli
* @param int $bla
*
* @throws \Exception
*
* @return bool
*/
PHP;
$this->assertSame($expectedDoc, $docComment->render(''));
}
@ -129,17 +135,19 @@ class DocCommentTest extends BaseTestCase
{
ParsedDocblock::addNewLineBetweenAnnotations(true);
$expectedDoc = '/**
* some desc
*
* @param string $bli
* @param int $bla
*
* @throws \Exception
*
* @return bool
*/
';
$expectedDoc = <<<'PHP'
/**
* some desc
*
* @param string $bli
* @param int $bla
*
* @throws \Exception
*
* @return bool
*/
PHP;
$docComment = DocComment::parsePreservingLength(
new Doc($expectedDoc),
);
@ -151,17 +159,21 @@ class DocCommentTest extends BaseTestCase
{
ParsedDocblock::addNewLineBetweenAnnotations(true);
$expectedDoc = '/**
* some desc
*
* @param string $bli
* @param int $bla
*
* @throws \Exception
*
* @return bool
*/
';
$expectedDoc = <<<'PHP'
/**
* some desc
*
* @param string $bli
* @param int $bla
*
* @throws \Exception
*
* @return bool
*/
PHP
. " ";
$docComment = DocComment::parsePreservingLength(
new Doc($expectedDoc),
);
@ -173,19 +185,21 @@ class DocCommentTest extends BaseTestCase
{
ParsedDocblock::addNewLineBetweenAnnotations(true);
$expectedDoc = '/**
* some self-referential desc with " * @return bool
* " as part of it.
*
* @param string $bli
* @param string $bli_this_suffix_is_kept
* @param int $bla
*
* @throws \Exception
*
* @return bool
*/
';
$expectedDoc = <<<'PHP'
/**
* some self-referential desc with " * @return bool
* " as part of it.
*
* @param string $bli
* @param string $bli_this_suffix_is_kept
* @param int $bla
*
* @throws \Exception
*
* @return bool
*/
PHP;
$docComment = DocComment::parsePreservingLength(
new Doc($expectedDoc),
);