public function testAnnotationClassMethodBlockToString() { $file = new PhpFile('foo'); $file->addChild(new PhpAnnotationBlock(array('date is the key', 'time is the core key'))); $class = new PhpClass('Foo'); $class->addChild(new PhpMethod('Bar')); $file->addChild($class); $this->assertSame("<?php\n/**\n * date is the key\n * time is the core key\n */\nclass Foo\n{\n public function Bar()\n {\n }\n}\n", $file->toString()); }
public function testExtendsFromNamespace() { $class = new PhpClass('Foo', false, '\\DOMDocument'); $this->assertSame("class Foo extends \\DOMDocument\n{\n}", $class->toString()); }
/** * @param PhpAnnotationBlockElement $annotationBlock * @return AbstractComponent */ public function addAnnotationBlockElement(PhpAnnotationBlockElement $annotationBlock) { $this->mainElement->addChild($annotationBlock); return $this; }