3 * phpDocumentor Param tag test.
7 * @author Mike van Riel <mike.vanriel@naenius.com>
8 * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
9 * @license http://www.opensource.org/licenses/mit-license.php MIT
10 * @link http://phpdoc.org
13 namespace phpDocumentor\Reflection\DocBlock\Tag;
16 * Test class for \phpDocumentor\Reflection\DocBlock\ParamTag
18 * @author Mike van Riel <mike.vanriel@naenius.com>
19 * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
20 * @license http://www.opensource.org/licenses/mit-license.php MIT
21 * @link http://phpdoc.org
23 class ParamTagTest extends \PHPUnit_Framework_TestCase
26 * Test that the \phpDocumentor\Reflection\DocBlock\Tag\ParamTag can
27 * understand the @param DocBlock.
30 * @param string $content
31 * @param string $extractedType
32 * @param string $extractedTypes
33 * @param string $extractedVarName
34 * @param string $extractedDescription
36 * @covers \phpDocumentor\Reflection\DocBlock\Tag\ParamTag
37 * @dataProvider provideDataForConstructor
41 public function testConstructorParsesInputsIntoCorrectFields(
49 $tag = new ParamTag($type, $content);
51 $this->assertEquals($type, $tag->getName());
52 $this->assertEquals($extractedType, $tag->getType());
53 $this->assertEquals($extractedTypes, $tag->getTypes());
54 $this->assertEquals($extractedVarName, $tag->getVariableName());
55 $this->assertEquals($extractedDescription, $tag->getDescription());
59 * Data provider for testConstructorParsesInputsIntoCorrectFields()
63 public function provideDataForConstructor()
66 array('param', 'int', 'int', array('int'), '', ''),
67 array('param', '$bob', '', array(), '$bob', ''),
86 'int $bob Number of bobs',
94 "int Description \n on multiple lines",
98 "Description \n on multiple lines"
102 "int \n\$bob Variable name on a new line",
106 "Variable name on a new line"
110 "\nint \$bob Type on a new line",