Yaffs site version 1.1
[yaffs-website] / vendor / phpdocumentor / reflection-docblock / tests / phpDocumentor / Reflection / DocBlock / Tag / LinkTagTest.php
1 <?php
2 /**
3  * phpDocumentor Link Tag Test
4  * 
5  * PHP version 5.3
6  *
7  * @author    Ben Selby <benmatselby@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\LinkTag
17  *
18  * @author    Ben Selby <benmatselby@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 LinkTagTest extends \PHPUnit_Framework_TestCase
24 {
25     /**
26      * Test that the \phpDocumentor\Reflection\DocBlock\Tag\LinkTag can create
27      * a link for the @link doc block.
28      *
29      * @param string $type
30      * @param string $content
31      * @param string $exContent
32      * @param string $exDescription
33      * @param string $exLink
34      *
35      * @covers \phpDocumentor\Reflection\DocBlock\Tag\LinkTag
36      * @dataProvider provideDataForConstuctor
37      *
38      * @return void
39      */
40     public function testConstructorParesInputsIntoCorrectFields(
41         $type,
42         $content,
43         $exContent,
44         $exDescription,
45         $exLink
46     ) {
47         $tag = new LinkTag($type, $content);
48
49         $this->assertEquals($type, $tag->getName());
50         $this->assertEquals($exContent, $tag->getContent());
51         $this->assertEquals($exDescription, $tag->getDescription());
52         $this->assertEquals($exLink, $tag->getLink());
53     }
54
55     /**
56      * Data provider for testConstructorParesInputsIntoCorrectFields
57      *
58      * @return array
59      */
60     public function provideDataForConstuctor()
61     {
62         // $type, $content, $exContent, $exDescription, $exLink
63         return array(
64             array(
65                 'link',
66                 'http://www.phpdoc.org/',
67                 'http://www.phpdoc.org/',
68                 'http://www.phpdoc.org/',
69                 'http://www.phpdoc.org/'
70             ),
71             array(
72                 'link',
73                 'http://www.phpdoc.org/ Testing',
74                 'http://www.phpdoc.org/ Testing',
75                 'Testing',
76                 'http://www.phpdoc.org/'
77             ),
78             array(
79                 'link',
80                 'http://www.phpdoc.org/ Testing comments',
81                 'http://www.phpdoc.org/ Testing comments',
82                 'Testing comments',
83                 'http://www.phpdoc.org/'
84             ),
85         );
86     }
87 }