Yaffs site version 1.1
[yaffs-website] / vendor / phpdocumentor / reflection-docblock / tests / phpDocumentor / Reflection / DocBlock / Tag / SinceTagTest.php
1 <?php
2 /**
3  * phpDocumentor Since 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\SinceTag
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 SinceTagTest extends \PHPUnit_Framework_TestCase
24 {
25     /**
26      * Test that the \phpDocumentor\Reflection\DocBlock\Tag\LinkTag can create
27      * a link for the @since doc block.
28      *
29      * @param string $type
30      * @param string $content
31      * @param string $exContent
32      * @param string $exDescription
33      * @param string $exVersion
34      *
35      * @covers \phpDocumentor\Reflection\DocBlock\Tag\SinceTag
36      * @dataProvider provideDataForConstuctor
37      *
38      * @return void
39      */
40     public function testConstructorParesInputsIntoCorrectFields(
41         $type,
42         $content,
43         $exContent,
44         $exDescription,
45         $exVersion
46     ) {
47         $tag = new SinceTag($type, $content);
48
49         $this->assertEquals($type, $tag->getName());
50         $this->assertEquals($exContent, $tag->getContent());
51         $this->assertEquals($exDescription, $tag->getDescription());
52         $this->assertEquals($exVersion, $tag->getVersion());
53     }
54
55     /**
56      * Data provider for testConstructorParesInputsIntoCorrectFields
57      *
58      * @return array
59      */
60     public function provideDataForConstuctor()
61     {
62         // $type, $content, $exContent, $exDescription, $exVersion
63         return array(
64             array(
65                 'since',
66                 '1.0 First release.',
67                 '1.0 First release.',
68                 'First release.',
69                 '1.0'
70             ),
71             array(
72                 'since',
73                 "1.0\nFirst release.",
74                 "1.0\nFirst release.",
75                 'First release.',
76                 '1.0'
77             ),
78             array(
79                 'since',
80                 "1.0\nFirst\nrelease.",
81                 "1.0\nFirst\nrelease.",
82                 "First\nrelease.",
83                 '1.0'
84             ),
85             array(
86                 'since',
87                 'Unfinished release',
88                 'Unfinished release',
89                 'Unfinished release',
90                 ''
91             ),
92             array(
93                 'since',
94                 '1.0',
95                 '1.0',
96                 '',
97                 '1.0'
98             ),
99             array(
100                 'since',
101                 'GIT: $Id$',
102                 'GIT: $Id$',
103                 '',
104                 'GIT: $Id$'
105             ),
106             array(
107                 'since',
108                 'GIT: $Id$ Dev build',
109                 'GIT: $Id$ Dev build',
110                 'Dev build',
111                 'GIT: $Id$'
112             )
113         );
114     }
115 }