1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 17:52:45 +01:00
psalm/tests/ClassLikeDocblockParserTest.php
Joe Hoyle e59670ef68
Add documentation to LSP (#5267)
* Add documention to LSP

Add descriptions for all Classes, Functions, Methods, Class Constants for LSP methods for Hover, SignatureInformation and Completions

* Descriptions for class name completions

* PHPCS

* Fix docblock being overriden

* Remove trailing comma in args

* Add description to function param before early `continue`

* Update php-language-server-protocol to 1.5

* Break up long array docblocks

* Break up docblock onto newline

Co-authored-by: Matthew Brown <github@muglug.com>
2021-02-24 10:14:04 -05:00

28 lines
745 B
PHP

<?php
namespace Psalm\Tests;
use PHPUnit\Framework\TestCase as BaseTestCase;
use Psalm\Aliases;
use Psalm\DocComment;
use Psalm\Internal\RuntimeCaches;
use Psalm\Internal\Scanner\ParsedDocblock;
use Psalm\Internal\PhpVisitor\Reflector\ClassLikeDocblockParser;
use PhpParser\Node\Stmt\Class_;
class ClassLikeDocblockParserTest extends \Psalm\Tests\TestCase
{
public function testDocblockDescription(): void
{
$doc = '/**
* Some Description
*
*/
';
$node = new Class_(null);
$php_parser_doc = new \PhpParser\Comment\Doc($doc);
$class_docblock = ClassLikeDocblockParser::parse($node, $php_parser_doc, new Aliases());
$this->assertSame('Some Description', $class_docblock->description);
}
}