/**
     * @test
     */
    public function useDocComment()
    {
        $name = 'example';
        $docComment = "A tests for DocComment.\n\n@var example";
        $formatedDocComment = "/**\n * A tests for DocComment.\n *\n * @var example\n */";
        $result = <<<EOF
/**
 * A tests for DocComment.
 *
 * @var example
 */
public \$example;
EOF;
        $property = new Stagehand_PHP_Class_Property($name);
        $property->setDocComment($docComment);
        $this->assertEquals($property->getDocComment(), $formatedDocComment);
        $this->assertEquals($property->render(), $result);
        $docComment = "/**\n * A tests for DocComment.\n *\n * @var example\n */";
        $property->setDocComment($docComment, true);
        $this->assertEquals($property->getDocComment(), $formatedDocComment);
        $this->assertEquals($property->render(), $result);
    }
Esempio n. 2
0
 /**
 * Creates a partial code for class property.
 *
 ` @param  Stagehand_PHP_Class_Property $property
 * @return string
 */
 protected function _createPropertyCode($property)
 {
     return $property->render();
 }