mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
Expand tests of Author tag with BaseTag covered functionality
This commit is contained in:
committed by
Mike van Riel
parent
0d29e96332
commit
260a74a77b
@@ -13,12 +13,6 @@
|
||||
namespace phpDocumentor\Reflection\DocBlock;
|
||||
|
||||
use Mockery as m;
|
||||
use phpDocumentor\Reflection\DocBlock\Description\PassthroughFormatter;
|
||||
use phpDocumentor\Reflection\DocBlock\Tags\Deprecated;
|
||||
use phpDocumentor\Reflection\DocBlock\Tags\Link;
|
||||
use phpDocumentor\Reflection\DocBlock\Tags\Other;
|
||||
use phpDocumentor\Reflection\Types\Context;
|
||||
|
||||
/**
|
||||
* @coversDefaultClass \phpDocumentor\Reflection\DocBlock\DescriptionFactory
|
||||
*/
|
||||
|
||||
@@ -13,8 +13,6 @@
|
||||
namespace phpDocumentor\Reflection\DocBlock\Tags;
|
||||
|
||||
use Mockery as m;
|
||||
use phpDocumentor\Reflection\DocBlock\Description;
|
||||
use phpDocumentor\Reflection\DocBlock\Tags\Other;
|
||||
|
||||
/**
|
||||
* @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\Author
|
||||
@@ -22,6 +20,44 @@ use phpDocumentor\Reflection\DocBlock\Tags\Other;
|
||||
*/
|
||||
class AuthorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Author::__construct
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName
|
||||
*/
|
||||
public function testIfCorrectTagNameIsReturned()
|
||||
{
|
||||
$fixture = new Author('Mike van Riel', '[email protected]');
|
||||
|
||||
$this->assertSame('author', $fixture->getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Author::__construct
|
||||
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Author::__toString
|
||||
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
|
||||
*/
|
||||
public function testIfTagCanBeRenderedUsingDefaultFormatter()
|
||||
{
|
||||
$fixture = new Author('Mike van Riel', '[email protected]');
|
||||
|
||||
$this->assertSame('Mike van Riel<[email protected]>', $fixture->render());
|
||||
}
|
||||
|
||||
/**
|
||||
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Author::__construct
|
||||
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render
|
||||
*/
|
||||
public function testIfTagCanBeRenderedUsingSpecificFormatter()
|
||||
{
|
||||
$fixture = new Author('Mike van Riel', '[email protected]');
|
||||
|
||||
$formatter = m::mock(Formatter::class);
|
||||
$formatter->shouldReceive('format')->with($fixture)->andReturn('Rendered output');
|
||||
|
||||
$this->assertSame('Rendered output', $fixture->render($formatter));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::__construct
|
||||
* @covers ::getAuthorName
|
||||
|
||||
Reference in New Issue
Block a user