You are here

class ThrowsTagTest in Zircon Profile 8.0

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

Test class for \phpDocumentor\Reflection\DocBlock\ThrowsTag

@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\ThrowsTagTest extends \phpDocumentor\Reflection\DocBlock\Tag\PHPUnit_Framework_TestCase

Expanded class hierarchy of ThrowsTagTest

File

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

Namespace

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

  /**
   * Test that the \phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag can
   * understand the @throws DocBlock.
   *
   * @param string $type
   * @param string $content
   * @param string $extractedType
   * @param string $extractedTypes
   * @param string $extractedDescription
   *
   * @covers \phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag
   * @dataProvider provideDataForConstructor
   *
   * @return void
   */
  public function testConstructorParsesInputsIntoCorrectFields($type, $content, $extractedType, $extractedTypes, $extractedDescription) {
    $tag = new ThrowsTag($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(
        'throws',
        '',
        '',
        array(),
        '',
      ),
      array(
        'throws',
        'int',
        'int',
        array(
          'int',
        ),
        '',
      ),
      array(
        'throws',
        'int Number of Bobs',
        'int',
        array(
          'int',
        ),
        'Number of Bobs',
      ),
      array(
        'throws',
        'int|double Number of Bobs',
        'int|double',
        array(
          'int',
          'double',
        ),
        'Number of Bobs',
      ),
      array(
        'throws',
        "int Number of \n Bobs",
        'int',
        array(
          'int',
        ),
        "Number of \n Bobs",
      ),
      array(
        'throws',
        " int Number of Bobs",
        'int',
        array(
          'int',
        ),
        "Number of Bobs",
      ),
      array(
        'throws',
        "int\nNumber of Bobs",
        'int',
        array(
          'int',
        ),
        "Number of Bobs",
      ),
    );
  }

}

Members

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