You are here

class ReturnTagTest in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php \phpDocumentor\Reflection\DocBlock\Tag\ReturnTagTest

Test class for \phpDocumentor\Reflection\DocBlock\ReturnTag

@author Mike van Riel <mike.vanriel@naenius.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

Hierarchy

  • class \phpDocumentor\Reflection\DocBlock\Tag\ReturnTagTest extends \phpDocumentor\Reflection\DocBlock\Tag\PHPUnit_Framework_TestCase

Expanded class hierarchy of ReturnTagTest

File

vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php, line 23

Namespace

phpDocumentor\Reflection\DocBlock\Tag
View source
class ReturnTagTest extends \PHPUnit_Framework_TestCase {

  /**
   * Test that the \phpDocumentor\Reflection\DocBlock\Tag\ReturnTag can
   * understand the @return DocBlock.
   *
   * @param string $type
   * @param string $content
   * @param string $extractedType
   * @param string $extractedTypes
   * @param string $extractedDescription
   *
   * @covers \phpDocumentor\Reflection\DocBlock\Tag\ReturnTag
   * @dataProvider provideDataForConstructor
   *
   * @return void
   */
  public function testConstructorParsesInputsIntoCorrectFields($type, $content, $extractedType, $extractedTypes, $extractedDescription) {
    $tag = new ReturnTag($type, $content);
    $this
      ->assertEquals($type, $tag
      ->getName());
    $this
      ->assertEquals($extractedType, $tag
      ->getType());
    $this
      ->assertEquals($extractedTypes, $tag
      ->getTypes());
    $this
      ->assertEquals($extractedDescription, $tag
      ->getDescription());
  }

  /**
   * Data provider for testConstructorParsesInputsIntoCorrectFields()
   *
   * @return array
   */
  public function provideDataForConstructor() {
    return array(
      array(
        'return',
        '',
        '',
        array(),
        '',
      ),
      array(
        'return',
        'int',
        'int',
        array(
          'int',
        ),
        '',
      ),
      array(
        'return',
        'int Number of Bobs',
        'int',
        array(
          'int',
        ),
        'Number of Bobs',
      ),
      array(
        'return',
        'int|double Number of Bobs',
        'int|double',
        array(
          'int',
          'double',
        ),
        'Number of Bobs',
      ),
      array(
        'return',
        "int Number of \n Bobs",
        'int',
        array(
          'int',
        ),
        "Number of \n Bobs",
      ),
      array(
        'return',
        " int Number of Bobs",
        'int',
        array(
          'int',
        ),
        "Number of Bobs",
      ),
      array(
        'return',
        "int\nNumber of Bobs",
        'int',
        array(
          'int',
        ),
        "Number of Bobs",
      ),
    );
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ReturnTagTest::provideDataForConstructor public function Data provider for testConstructorParsesInputsIntoCorrectFields()
ReturnTagTest::testConstructorParsesInputsIntoCorrectFields public function Test that the \phpDocumentor\Reflection\DocBlock\Tag\ReturnTag can understand the @covers \phpDocumentor\Reflection\DocBlock\Tag\ReturnTag @dataProvider provideDataForConstructor