Yaffs site version 1.1
[yaffs-website] / vendor / phpdocumentor / reflection-docblock / tests / phpDocumentor / Reflection / DocBlock / Tag / ExampleTagTest.php
1 <?php
2 /**
3  * phpDocumentor Example 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\ExampleTag
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 ExampleTagTest 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      * @param string $exFilepath
35      *
36      * @covers \phpDocumentor\Reflection\DocBlock\Tag\ExampleTag
37      * @dataProvider provideDataForConstuctor
38      *
39      * @return void
40      */
41     public function testConstructorParesInputsIntoCorrectFields(
42         $type,
43         $content,
44         $exContent,
45         $exDescription,
46         $exStartingLine,
47         $exLineCount,
48         $exFilePath
49     ) {
50         $tag = new ExampleTag($type, $content);
51
52         $this->assertEquals($type, $tag->getName());
53         $this->assertEquals($exContent, $tag->getContent());
54         $this->assertEquals($exDescription, $tag->getDescription());
55         $this->assertEquals($exStartingLine, $tag->getStartingLine());
56         $this->assertEquals($exLineCount, $tag->getLineCount());
57         $this->assertEquals($exFilePath, $tag->getFilePath());
58     }
59
60     /**
61      * Data provider for testConstructorParesInputsIntoCorrectFields
62      *
63      * @return array
64      */
65     public function provideDataForConstuctor()
66     {
67         // $type,
68         // $content,
69         // $exContent,
70         // $exDescription,
71         // $exStartingLine,
72         // $exLineCount,
73         // $exFilePath
74         return array(
75             array(
76                 'example',
77                 'file.php',
78                 'file.php',
79                 '',
80                 1,
81                 null,
82                 'file.php'
83             ),
84             array(
85                 'example',
86                 'Testing comments',
87                 'Testing comments',
88                 'comments',
89                 1,
90                 null,
91                 'Testing'
92             ),
93             array(
94                 'example',
95                 'file.php 2 Testing',
96                 'file.php 2 Testing',
97                 'Testing',
98                 2,
99                 null,
100                 'file.php'
101             ),
102             array(
103                 'example',
104                 'file.php 2 3 Testing comments',
105                 'file.php 2 3 Testing comments',
106                 'Testing comments',
107                 2,
108                 3,
109                 'file.php'
110             ),
111             array(
112                 'example',
113                 'file.php 2 -1 Testing comments',
114                 'file.php 2 -1 Testing comments',
115                 '-1 Testing comments',
116                 2,
117                 null,
118                 'file.php'
119             ),
120             array(
121                 'example',
122                 'file.php -1 1 Testing comments',
123                 'file.php -1 1 Testing comments',
124                 '-1 1 Testing comments',
125                 1,
126                 null,
127                 'file.php'
128             ),
129             array(
130                 'example',
131                 '"file with spaces.php" Testing comments',
132                 '"file with spaces.php" Testing comments',
133                 'Testing comments',
134                 1,
135                 null,
136                 'file with spaces.php'
137             ),
138             array(
139                 'example',
140                 '"file with spaces.php" 2 Testing comments',
141                 '"file with spaces.php" 2 Testing comments',
142                 'Testing comments',
143                 2,
144                 null,
145                 'file with spaces.php'
146             ),
147             array(
148                 'example',
149                 '"file with spaces.php" 2 3 Testing comments',
150                 '"file with spaces.php" 2 3 Testing comments',
151                 'Testing comments',
152                 2,
153                 3,
154                 'file with spaces.php'
155             ),
156             array(
157                 'example',
158                 '"file with spaces.php" 2 -3 Testing comments',
159                 '"file with spaces.php" 2 -3 Testing comments',
160                 '-3 Testing comments',
161                 2,
162                 null,
163                 'file with spaces.php'
164             ),
165             array(
166                 'example',
167                 '"file with spaces.php" -2 3 Testing comments',
168                 '"file with spaces.php" -2 3 Testing comments',
169                 '-2 3 Testing comments',
170                 1,
171                 null,
172                 'file with spaces.php'
173             ),
174             array(
175                 'example',
176                 'file%20with%20spaces.php Testing comments',
177                 'file%20with%20spaces.php Testing comments',
178                 'Testing comments',
179                 1,
180                 null,
181                 'file with spaces.php'
182             ),
183             array(
184                 'example',
185                 'folder/file%20with%20spaces.php Testing comments',
186                 'folder/file%20with%20spaces.php Testing comments',
187                 'Testing comments',
188                 1,
189                 null,
190                 'folder/file with spaces.php'
191             ),
192             array(
193                 'example',
194                 'http://example.com/file%20with%20spaces.php Testing comments',
195                 'http://example.com/file%20with%20spaces.php Testing comments',
196                 'Testing comments',
197                 1,
198                 null,
199                 'http://example.com/file%20with%20spaces.php'
200             )
201         );
202     }
203 }