From 879863322174573d05fdae4722fddd38cfba2aa2 Mon Sep 17 00:00:00 2001 From: Mike van Riel Date: Sun, 14 Jun 2015 00:10:36 +0200 Subject: [PATCH] Add test for passthroughformatter --- .../Formatter/PassthroughFormatterTest.php | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 tests/unit/DocBlock/Tags/Formatter/PassthroughFormatterTest.php diff --git a/tests/unit/DocBlock/Tags/Formatter/PassthroughFormatterTest.php b/tests/unit/DocBlock/Tags/Formatter/PassthroughFormatterTest.php new file mode 100644 index 0000000..66edfa2 --- /dev/null +++ b/tests/unit/DocBlock/Tags/Formatter/PassthroughFormatterTest.php @@ -0,0 +1,41 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags\Formatter; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\Tags\Other; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + */ +class PassthroughFormatterTest extends \PHPUnit_Framework_TestCase +{ + /** + * @covers ::format + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Other + */ + public function testFormatterCallsToStringAndReturnsAStandardRepresentation() + { + $expected = '@unknown-tag This is a description'; + + $fixture = new PassthroughFormatter(); + + $this->assertSame( + $expected, + $fixture->format(new Other('unknown-tag', new Description('This is a description'))) + ); + } +}