Yaffs site version 1.1
[yaffs-website] / vendor / phpdocumentor / reflection-docblock / tests / phpDocumentor / Reflection / DocBlock / Tag / VarTagTest.php
1 <?php
2 /**
3  * phpDocumentor Var Tag Test
4  * 
5  * PHP version 5.3
6  *
7  * @author    Daniel O'Connor <daniel.oconnor@gmail.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
11  */
12
13 namespace phpDocumentor\Reflection\DocBlock\Tag;
14
15 /**
16  * Test class for \phpDocumentor\Reflection\DocBlock\Tag\VarTag
17  *
18  * @author    Daniel O'Connor <daniel.oconnor@gmail.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
22  */
23 class VarTagTest extends \PHPUnit_Framework_TestCase
24 {
25     /**
26      * Test that the \phpDocumentor\Reflection\DocBlock\Tag\VarTag can
27      * understand the @var doc block.
28      *
29      * @param string $type
30      * @param string $content
31      * @param string $exType
32      * @param string $exVariable
33      * @param string $exDescription
34      *
35      * @covers \phpDocumentor\Reflection\DocBlock\Tag\VarTag
36      * @dataProvider provideDataForConstuctor
37      *
38      * @return void
39      */
40     public function testConstructorParesInputsIntoCorrectFields(
41         $type,
42         $content,
43         $exType,
44         $exVariable,
45         $exDescription
46     ) {
47         $tag = new VarTag($type, $content);
48
49         $this->assertEquals($type, $tag->getName());
50         $this->assertEquals($exType, $tag->getType());
51         $this->assertEquals($exVariable, $tag->getVariableName());
52         $this->assertEquals($exDescription, $tag->getDescription());
53     }
54
55     /**
56      * Data provider for testConstructorParesInputsIntoCorrectFields
57      *
58      * @return array
59      */
60     public function provideDataForConstuctor()
61     {
62         // $type, $content, $exType, $exVariable, $exDescription
63         return array(
64             array(
65                 'var',
66                 'int',
67                 'int',
68                 '',
69                 ''
70             ),
71             array(
72                 'var',
73                 'int $bob',
74                 'int',
75                 '$bob',
76                 ''
77             ),
78             array(
79                 'var',
80                 'int $bob Number of bobs',
81                 'int',
82                 '$bob',
83                 'Number of bobs'
84             ),
85             array(
86                 'var',
87                 '',
88                 '',
89                 '',
90                 ''
91             ),
92         );
93     }
94 }