Yaffs site version 1.1
[yaffs-website] / vendor / phpdocumentor / reflection-docblock / tests / phpDocumentor / Reflection / DocBlock / Tag / SourceTagTest.php
1 <?php
2 /**
3  * phpDocumentor Source Tag Test
4  * 
5  * PHP version 5.3
6  *
7  * @author    Vasil Rangelov <boen.robot@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\SourceTag
17  *
18  * @author    Vasil Rangelov <boen.robot@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 SourceTagTest extends \PHPUnit_Framework_TestCase
24 {
25     /**
26      * Test that the \phpDocumentor\Reflection\DocBlock\Tag\SourceTag can
27      * understand the @source DocBlock.
28      *
29      * @param string $type
30      * @param string $content
31      * @param string $exContent
32      * @param string $exStartingLine
33      * @param string $exLineCount
34      *
35      * @covers \phpDocumentor\Reflection\DocBlock\Tag\SourceTag
36      * @dataProvider provideDataForConstuctor
37      *
38      * @return void
39      */
40     public function testConstructorParesInputsIntoCorrectFields(
41         $type,
42         $content,
43         $exContent,
44         $exDescription,
45         $exStartingLine,
46         $exLineCount
47     ) {
48         $tag = new SourceTag($type, $content);
49
50         $this->assertEquals($type, $tag->getName());
51         $this->assertEquals($exContent, $tag->getContent());
52         $this->assertEquals($exDescription, $tag->getDescription());
53         $this->assertEquals($exStartingLine, $tag->getStartingLine());
54         $this->assertEquals($exLineCount, $tag->getLineCount());
55     }
56
57     /**
58      * Data provider for testConstructorParesInputsIntoCorrectFields
59      *
60      * @return array
61      */
62     public function provideDataForConstuctor()
63     {
64         // $type, $content, $exContent, $exDescription, $exStartingLine, $exLineCount
65         return array(
66             array(
67                 'source',
68                 '2',
69                 '2',
70                 '',
71                 2,
72                 null
73             ),
74             array(
75                 'source',
76                 'Testing',
77                 'Testing',
78                 'Testing',
79                 1,
80                 null
81             ),
82             array(
83                 'source',
84                 '2 Testing',
85                 '2 Testing',
86                 'Testing',
87                 2,
88                 null
89             ),
90             array(
91                 'source',
92                 '2 3 Testing comments',
93                 '2 3 Testing comments',
94                 'Testing comments',
95                 2,
96                 3
97             ),
98             array(
99                 'source',
100                 '2 -1 Testing comments',
101                 '2 -1 Testing comments',
102                 '-1 Testing comments',
103                 2,
104                 null
105             ),
106             array(
107                 'source',
108                 '-1 1 Testing comments',
109                 '-1 1 Testing comments',
110                 '-1 1 Testing comments',
111                 1,
112                 null
113             )
114         );
115     }
116 }