/** * Set parent node * * @param Zend_Server_Reflection_Node $node * @param boolean $new Whether or not the child node is newly created * and should always be attached * @return void */ public function setParent(Zend_Server_Reflection_Node $node, $new = false) { $this->_parent = $node; if ($new) { $node->attachChild($this); return; } }
/** * attachChild() test */ public function testAttachChild() { $parent = new Zend_Server_Reflection_Node('string'); $child = new Zend_Server_Reflection_Node('array'); $parent->attachChild($child); $this->assertTrue($parent === $child->getParent()); $children = $parent->getChildren(); $this->assertTrue($child === $children[0]); }