mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
Add failing testcase for long method name
This commit is contained in:
committed by
Mike van Riel
parent
e2ce1d210a
commit
8727095d6b
@@ -342,6 +342,37 @@ class MethodTest extends TestCase
|
|||||||
$this->assertInstanceOf(This::class, $fixture->getReturnType());
|
$this->assertInstanceOf(This::class, $fixture->getReturnType());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Method::<public>
|
||||||
|
* @uses \phpDocumentor\Reflection\TypeResolver
|
||||||
|
* @uses \phpDocumentor\Reflection\DocBlock\Description
|
||||||
|
* @uses \phpDocumentor\Reflection\Types\Context
|
||||||
|
*
|
||||||
|
* @covers ::create
|
||||||
|
*/
|
||||||
|
public function testReturnTypeNoneWithLongMethodName() : void
|
||||||
|
{
|
||||||
|
$descriptionFactory = m::mock(DescriptionFactory::class);
|
||||||
|
$resolver = new TypeResolver();
|
||||||
|
$context = new Context('');
|
||||||
|
|
||||||
|
$description = new Description('');
|
||||||
|
|
||||||
|
$descriptionFactory->shouldReceive('create')->with('', $context)->andReturn($description);
|
||||||
|
|
||||||
|
$fixture = Method::create(
|
||||||
|
'myVeryLongMethodName($node)',
|
||||||
|
$resolver,
|
||||||
|
$descriptionFactory,
|
||||||
|
$context
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->assertFalse($fixture->isStatic());
|
||||||
|
$this->assertSame('void myVeryLongMethodName(mixed $node)', (string) $fixture);
|
||||||
|
$this->assertSame('myVeryLongMethodName', $fixture->getMethodName());
|
||||||
|
$this->assertInstanceOf(Void_::class, $fixture->getReturnType());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string[][]
|
* @return string[][]
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user