Exemplo n.º 1
0
    /**
     * @covers \phpDocumentor\Reflection\DocBlock
     * 
     * @return void
     */
    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());
    }