3 * phpDocumentor Throws 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\ThrowsTag
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 ThrowsTagTest extends \PHPUnit_Framework_TestCase
26 * Test that the \phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag can
27 * understand the @throws DocBlock.
30 * @param string $content
31 * @param string $extractedType
32 * @param string $extractedTypes
33 * @param string $extractedDescription
35 * @covers \phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag
36 * @dataProvider provideDataForConstructor
40 public function testConstructorParsesInputsIntoCorrectFields(
47 $tag = new ThrowsTag($type, $content);
49 $this->assertEquals($type, $tag->getName());
50 $this->assertEquals($extractedType, $tag->getType());
51 $this->assertEquals($extractedTypes, $tag->getTypes());
52 $this->assertEquals($extractedDescription, $tag->getDescription());
56 * Data provider for testConstructorParsesInputsIntoCorrectFields()
60 public function provideDataForConstructor()
63 array('throws', '', '', array(), ''),
64 array('throws', 'int', 'int', array('int'), ''),
74 'int|double Number of Bobs',
76 array('int', 'double'),
81 "int Number of \n Bobs",
88 " int Number of Bobs",
95 "int\nNumber of Bobs",