Skip to content

Commit 2318e5e

Browse files
yunoshjaapio
authored andcommitted
Add unit test.
1 parent 47ace60 commit 2318e5e

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

src/DocBlock/Tags/Formatter/AlignFormatter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* For the full copyright and license information, please view the LICENSE
66
* file that was distributed with this source code.
77
*
8+
* @author Jan Schneider <[email protected]>
89
* @copyright 2017 Mike van Riel<[email protected]>
910
* @license http://www.opensource.org/licenses/mit-license.php MIT
1011
* @link http://phpdoc.org
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?php
2+
/**
3+
* This file is part of phpDocumentor.
4+
*
5+
* For the full copyright and license information, please view the LICENSE
6+
* file that was distributed with this source code.
7+
*
8+
* @author Jan Schneider <[email protected]>
9+
* @copyright 2017 Mike van Riel<[email protected]>
10+
* @license http://www.opensource.org/licenses/mit-license.php MIT
11+
* @link http://phpdoc.org
12+
*/
13+
14+
namespace phpDocumentor\Reflection\DocBlock\Tags\Formatter;
15+
16+
use phpDocumentor\Reflection\DocBlock\Description;
17+
use phpDocumentor\Reflection\DocBlock\Tags\Link;
18+
use phpDocumentor\Reflection\DocBlock\Tags\Param;
19+
use phpDocumentor\Reflection\DocBlock\Tags\Version;
20+
use phpDocumentor\Reflection\Types\String_;
21+
22+
/**
23+
* @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\Formatter\AlignFormatter
24+
*/
25+
class PassthroughFormatterTest extends \PHPUnit_Framework_TestCase
26+
{
27+
/**
28+
* @covers ::format
29+
* @uses \phpDocumentor\Reflection\DocBlock\Description
30+
* @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag
31+
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Link
32+
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Param
33+
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Version
34+
* @uses \phpDocumentor\Reflection\Types\String_
35+
*/
36+
public function testFormatterCallsToStringAndReturnsAStandardRepresentation()
37+
{
38+
$tags = array(
39+
new Param('foobar', new String_()),
40+
new Version('1.2.0'),
41+
new Link('http://www.example.com', new Description('Examples'))
42+
);
43+
$fixture = new AlignFormatter($tags);
44+
45+
$expected = array(
46+
'@param string $foobar',
47+
'@version 1.2.0',
48+
'@link http://www.example.com Examples'
49+
);
50+
51+
foreach ($tags as $key => $tag) {
52+
$this->assertSame(
53+
$expected[$key],
54+
$fixture->format($tag)
55+
);
56+
}
57+
}
58+
}

0 commit comments

Comments
 (0)