gossi\codegen\tests\model\DocblockTest::testClass PHP 메소드

testClass() 공개 메소드

public testClass ( )
    public function testClass()
    {
        $class = new PhpClass();
        $class->setName('class-name')->setDescription('this is my class')->setLongDescription('this is my very long class')->setProperty($this->getProperty())->setMethod($this->getMethod())->setConstant($this->getConstant())->generateDocblock();
        $this->assertFalse($class->getDocblock()->isEmpty());
        $this->assertNotNull($class->getProperty(self::PROP)->getDocblock());
        $this->assertNotNull($class->getMethod(self::METHOD)->getDocblock());
        $this->assertNotNull($class->getConstant(self::CONSTANT)->getDocblock());
        $docblock = $class->getDocblock();
        $author = AuthorTag::create()->setName('gossi')->setEmail('[email protected]');
        $docblock->appendTag($author);
        $this->assertTrue($docblock->hasTag('author'));
        $expected = '/**
 * this is my class
 * 
 * this is my very long class
 * 
 * @author gossi <[email protected]>
 */';
        $this->assertEquals($expected, $docblock->toString());
    }