Yaffs site version 1.1
[yaffs-website] / vendor / phpdocumentor / reflection-docblock / tests / phpDocumentor / Reflection / DocBlock / Tag / VarTagTest.php
diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php
new file mode 100644 (file)
index 0000000..9ae2aa5
--- /dev/null
@@ -0,0 +1,94 @@
+<?php
+/**
+ * phpDocumentor Var Tag Test
+ * 
+ * PHP version 5.3
+ *
+ * @author    Daniel O'Connor <daniel.oconnor@gmail.com>
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license   http://www.opensource.org/licenses/mit-license.php MIT
+ * @link      http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\VarTag
+ *
+ * @author    Daniel O'Connor <daniel.oconnor@gmail.com>
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license   http://www.opensource.org/licenses/mit-license.php MIT
+ * @link      http://phpdoc.org
+ */
+class VarTagTest extends \PHPUnit_Framework_TestCase
+{
+    /**
+     * Test that the \phpDocumentor\Reflection\DocBlock\Tag\VarTag can
+     * understand the @var doc block.
+     *
+     * @param string $type
+     * @param string $content
+     * @param string $exType
+     * @param string $exVariable
+     * @param string $exDescription
+     *
+     * @covers \phpDocumentor\Reflection\DocBlock\Tag\VarTag
+     * @dataProvider provideDataForConstuctor
+     *
+     * @return void
+     */
+    public function testConstructorParesInputsIntoCorrectFields(
+        $type,
+        $content,
+        $exType,
+        $exVariable,
+        $exDescription
+    ) {
+        $tag = new VarTag($type, $content);
+
+        $this->assertEquals($type, $tag->getName());
+        $this->assertEquals($exType, $tag->getType());
+        $this->assertEquals($exVariable, $tag->getVariableName());
+        $this->assertEquals($exDescription, $tag->getDescription());
+    }
+
+    /**
+     * Data provider for testConstructorParesInputsIntoCorrectFields
+     *
+     * @return array
+     */
+    public function provideDataForConstuctor()
+    {
+        // $type, $content, $exType, $exVariable, $exDescription
+        return array(
+            array(
+                'var',
+                'int',
+                'int',
+                '',
+                ''
+            ),
+            array(
+                'var',
+                'int $bob',
+                'int',
+                '$bob',
+                ''
+            ),
+            array(
+                'var',
+                'int $bob Number of bobs',
+                'int',
+                '$bob',
+                'Number of bobs'
+            ),
+            array(
+                'var',
+                '',
+                '',
+                '',
+                ''
+            ),
+        );
+    }
+}