Fix issue with missing registered factory

This commit is contained in:
Jaapio
2022-11-14 22:00:05 +01:00
parent ec81b5479a
commit 29e383a759
3 changed files with 48 additions and 0 deletions
@@ -17,11 +17,14 @@ use Mockery as m;
use phpDocumentor\Reflection\DocBlock\Description;
use phpDocumentor\Reflection\DocBlock\StandardTagFactory;
use phpDocumentor\Reflection\DocBlock\Tag;
use phpDocumentor\Reflection\DocBlock\Tags\Method;
use phpDocumentor\Reflection\DocBlock\Tags\MethodParameter;
use phpDocumentor\Reflection\DocBlock\Tags\Param;
use phpDocumentor\Reflection\DocBlock\Tags\See;
use phpDocumentor\Reflection\Types\Array_;
use phpDocumentor\Reflection\Types\Integer;
use phpDocumentor\Reflection\Types\String_;
use phpDocumentor\Reflection\Types\Void_;
use PHPUnit\Framework\TestCase;
/**
@@ -185,4 +188,35 @@ DOC;
);
}
public function testMethodRegression(): void
{
$docCommment = <<<DOC
/**
* This is an example of a summary.
*
* @method void setInteger(integer \$integer)
*/
DOC;
$factory = DocBlockFactory::createInstance();
$docblock = $factory->create($docCommment);
self::assertEquals(
[
new Method(
'setInteger',
[],
new Void_(),
false,
new Description(''),
false,
[
new MethodParameter('integer', new Integer())
]
),
],
$docblock->getTags()
);
}
}