public function testBuildClass()
    {
        $classNode = ClassNode::create('MyClass');
        $this->assertEquals('class MyClass {}', $classNode->getText());
        $classNode->setFinal(TRUE);
        $this->assertEquals('final class MyClass {}', $classNode->getText());
        $classNode->setFinal(FALSE);
        $this->assertEquals('class MyClass {}', $classNode->getText());
        $classNode->setName('MyTest');
        $this->assertEquals('class MyTest {}', $classNode->getText());
        $classNode->setExtends('MyClass');
        $this->assertEquals('class MyTest extends MyClass {}', $classNode->getText());
        $classNode->setExtends('BaseClass');
        $this->assertEquals('class MyTest extends BaseClass {}', $classNode->getText());
        $classNode->setExtends(NULL);
        $this->assertNull($classNode->getExtends());
        $this->assertEquals('class MyTest {}', $classNode->getText());
        $classNode->setImplements('MyInterface');
        $this->assertEquals('class MyTest implements MyInterface {}', $classNode->getText());
        $classNode->setImplements('Yai');
        $this->assertEquals('class MyTest implements Yai {}', $classNode->getText());
        $classNode->setImplements(NULL);
        $this->assertNull($classNode->getImplementList());
        $this->assertEquals('class MyTest {}', $classNode->getText());
        $classNode->appendProperty('someProperty');
        $classNode->appendMethod('someMethod');
        $expected = <<<'EOF'
class MyTest {

  private $someProperty;

  public function someMethod() {
  }

}
EOF;
        $this->assertEquals($expected, $classNode->getText());
        $property = $classNode->getProperty('someProperty');
        $property->getClassMemberListNode()->setDocComment(DocCommentNode::create('Some property.'));
        $method = $classNode->getMethod('someMethod');
        $method->setDocComment(DocCommentNode::create('Some method.'));
        $expected = <<<'EOF'
class MyTest {

  /**
   * Some property.
   */
  private $someProperty;

  /**
   * Some method.
   */
  public function someMethod() {
  }

}
EOF;
        $this->assertEquals($expected, $classNode->getText());
    }
 public function testChangeDocComment()
 {
     $node = ClassNode::create('Foo');
     $node->setDocComment(DocCommentNode::create('Ni!'));
     $node->setDocComment(DocCommentNode::create('Noo!'));
     $comment = $node->getDocComment();
     $this->assertInstanceOf('\\Pharborist\\DocCommentNode', $comment);
     $this->assertEquals('Noo!', $comment->getCommentText());
 }
    public function testClassMethodNode()
    {
        $method = ClassMethodNode::create('foo');
        $method->setDocComment(DocCommentNode::create('{@inheritdoc}'));
        $expected = <<<'END'
/**
 * {@inheritdoc}
 */
public function foo() {}
END;
        $this->assertEquals($expected, $method->getText());
    }