mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
Improvements to code
This commit is contained in:
@@ -332,7 +332,7 @@ class StandardTagFactoryTest extends TestCase
|
||||
$this->assertSame('return', $tag->getName());
|
||||
}
|
||||
|
||||
public function testInvalidTagIsReturnedOnFailure()
|
||||
public function testInvalidTagIsReturnedOnFailure() : void
|
||||
{
|
||||
$tagFactory = new StandardTagFactory(m::mock(FqsenResolver::class));
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpDocumentor\Reflection\DocBlock\Tags;
|
||||
|
||||
use Exception;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\InvalidTag
|
||||
* @covers ::<private>
|
||||
* @covers ::getName
|
||||
* @covers ::render
|
||||
* @covers ::getException
|
||||
* @covers ::create
|
||||
*/
|
||||
final class InvalidTagTest extends TestCase
|
||||
{
|
||||
public function testCreationWithoutError() : void
|
||||
{
|
||||
$tag = InvalidTag::create('Body', 'name');
|
||||
|
||||
self::assertSame('name', $tag->getName());
|
||||
self::assertSame('@name Body', $tag->render());
|
||||
self::assertNull($tag->getException());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::withError
|
||||
*/
|
||||
public function testCreationWithError() : void
|
||||
{
|
||||
$exception = new Exception();
|
||||
$tag = InvalidTag::create('Body', 'name')->withError($exception);
|
||||
|
||||
self::assertSame('name', $tag->getName());
|
||||
self::assertSame('@name Body', $tag->render());
|
||||
self::assertSame($exception, $tag->getException());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user