|
| 1 | +<?php |
| 2 | + |
| 3 | +/** |
| 4 | + * phpDocumentor Template Tag Test |
| 5 | + * |
| 6 | + * PHP version 5.3 |
| 7 | + * |
| 8 | + * @author Daniel O'Connor <[email protected]> |
| 9 | + * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) |
| 10 | + * @license http://www.opensource.org/licenses/mit-license.php MIT |
| 11 | + * @link http://phpdoc.org |
| 12 | + */ |
| 13 | + |
| 14 | +namespace Barryvdh\Reflection\DocBlock\Tag; |
| 15 | + |
| 16 | +use PHPUnit\Framework\TestCase; |
| 17 | + |
| 18 | +/** |
| 19 | + * Test class for \Barryvdh\Reflection\DocBlock\Tag\TemplateTag |
| 20 | + * |
| 21 | + * @author Daniel O'Connor <[email protected]> |
| 22 | + * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) |
| 23 | + * @license http://www.opensource.org/licenses/mit-license.php MIT |
| 24 | + * @link http://phpdoc.org |
| 25 | + */ |
| 26 | +class TemplateTagTest extends TestCase |
| 27 | +{ |
| 28 | + /** |
| 29 | + * Test that the phpDocumentor_Reflection_DocBlock_Tag_See can create a link |
| 30 | + * for the @see doc block. |
| 31 | + * |
| 32 | + * @param string $type |
| 33 | + * @param string $content |
| 34 | + * @param string $exContent |
| 35 | + * @param string $exReference |
| 36 | + * |
| 37 | + * @covers \Barryvdh\Reflection\DocBlock\Tag\SeeTag |
| 38 | + * @dataProvider provideDataForConstuctor |
| 39 | + * |
| 40 | + * @return void |
| 41 | + */ |
| 42 | + public function testConstructorParesInputsIntoCorrectFields( |
| 43 | + $type, |
| 44 | + $content, |
| 45 | + $exContent, |
| 46 | + $exDescription, |
| 47 | + $exTemplateName, |
| 48 | + $exBound |
| 49 | + ) { |
| 50 | + $tag = new TemplateTag($type, $content); |
| 51 | + |
| 52 | + $this->assertEquals($type, $tag->getName()); |
| 53 | + $this->assertEquals($exContent, $tag->getContent()); |
| 54 | + $this->assertEquals($exDescription, $tag->getDescription()); |
| 55 | + $this->assertEquals($exTemplateName, $tag->getTemplateName()); |
| 56 | + $this->assertEquals($exBound, $tag->getBound()); |
| 57 | + } |
| 58 | + |
| 59 | + /** |
| 60 | + * Data provider for testConstructorParesInputsIntoCorrectFields |
| 61 | + * |
| 62 | + * @return array |
| 63 | + */ |
| 64 | + public function provideDataForConstuctor() |
| 65 | + { |
| 66 | + // $type, $content, $exContent, $exDescription, $exTemplateName, $exBound |
| 67 | + return array( |
| 68 | + array( |
| 69 | + 'template', |
| 70 | + 'TValue', |
| 71 | + 'TValue', |
| 72 | + '', |
| 73 | + 'TValue', |
| 74 | + null, |
| 75 | + ), |
| 76 | + array( |
| 77 | + 'template', |
| 78 | + 'TValue of string', |
| 79 | + 'TValue of string', |
| 80 | + '', |
| 81 | + 'TValue', |
| 82 | + 'string', |
| 83 | + ), |
| 84 | + ); |
| 85 | + } |
| 86 | +} |
0 commit comments