You are here

public function DocBlockTest::testConstruct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlockTest.php \phpDocumentor\Reflection\DocBlockTest::testConstruct()

@covers \phpDocumentor\Reflection\DocBlock

Return value

void

File

vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlockTest.php, line 34

Class

DocBlockTest
Test class for phpDocumentor\Reflection\DocBlock

Namespace

phpDocumentor\Reflection

Code

public function testConstruct() {
  $fixture = <<<DOCBLOCK
/**
 * This is a short description
 *
 * This is a long description
 *
 * @see \\MyClass
 * @return void
 */
DOCBLOCK;
  $object = new DocBlock($fixture, new Context('\\MyNamespace', array(
    'PHPDoc' => '\\phpDocumentor',
  )), new Location(2));
  $this
    ->assertEquals('This is a short description', $object
    ->getShortDescription());
  $this
    ->assertEquals('This is a long description', $object
    ->getLongDescription()
    ->getContents());
  $this
    ->assertCount(2, $object
    ->getTags());
  $this
    ->assertTrue($object
    ->hasTag('see'));
  $this
    ->assertTrue($object
    ->hasTag('return'));
  $this
    ->assertFalse($object
    ->hasTag('category'));
  $this
    ->assertSame('MyNamespace', $object
    ->getContext()
    ->getNamespace());
  $this
    ->assertSame(array(
    'PHPDoc' => '\\phpDocumentor',
  ), $object
    ->getContext()
    ->getNamespaceAliases());
  $this
    ->assertSame(2, $object
    ->getLocation()
    ->getLineNumber());
}