mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 18:13:13 +00:00
Add unit test.
This commit is contained in:
committed by
Jaap van Otterdijk
parent
47ace60533
commit
2318e5eb97
@@ -5,6 +5,7 @@
|
|||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*
|
*
|
||||||
|
* @author Jan Schneider <[email protected]>
|
||||||
* @copyright 2017 Mike van Riel<[email protected]>
|
* @copyright 2017 Mike van Riel<[email protected]>
|
||||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
* @link http://phpdoc.org
|
* @link http://phpdoc.org
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This file is part of phpDocumentor.
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*
|
||||||
|
* @author Jan Schneider <[email protected]>
|
||||||
|
* @copyright 2017 Mike van Riel<[email protected]>
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||||
|
* @link http://phpdoc.org
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace phpDocumentor\Reflection\DocBlock\Tags\Formatter;
|
||||||
|
|
||||||
|
use phpDocumentor\Reflection\DocBlock\Description;
|
||||||
|
use phpDocumentor\Reflection\DocBlock\Tags\Link;
|
||||||
|
use phpDocumentor\Reflection\DocBlock\Tags\Param;
|
||||||
|
use phpDocumentor\Reflection\DocBlock\Tags\Version;
|
||||||
|
use phpDocumentor\Reflection\Types\String_;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\Formatter\AlignFormatter
|
||||||
|
*/
|
||||||
|
class PassthroughFormatterTest extends \PHPUnit_Framework_TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @covers ::format
|
||||||
|
* @uses \phpDocumentor\Reflection\DocBlock\Description
|
||||||
|
* @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag
|
||||||
|
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Link
|
||||||
|
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Param
|
||||||
|
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Version
|
||||||
|
* @uses \phpDocumentor\Reflection\Types\String_
|
||||||
|
*/
|
||||||
|
public function testFormatterCallsToStringAndReturnsAStandardRepresentation()
|
||||||
|
{
|
||||||
|
$tags = array(
|
||||||
|
new Param('foobar', new String_()),
|
||||||
|
new Version('1.2.0'),
|
||||||
|
new Link('http://www.example.com', new Description('Examples'))
|
||||||
|
);
|
||||||
|
$fixture = new AlignFormatter($tags);
|
||||||
|
|
||||||
|
$expected = array(
|
||||||
|
'@param string $foobar',
|
||||||
|
'@version 1.2.0',
|
||||||
|
'@link http://www.example.com Examples'
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ($tags as $key => $tag) {
|
||||||
|
$this->assertSame(
|
||||||
|
$expected[$key],
|
||||||
|
$fixture->format($tag)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user