Expand tests of Author tag with BaseTag covered functionality

This commit is contained in:
Mike van Riel
2015-06-14 08:18:12 +02:00
committed by Mike van Riel
parent 0d29e96332
commit 260a74a77b
2 changed files with 38 additions and 8 deletions
@@ -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
*/
+38 -2
View File
@@ -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