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