예제 #1
0
 /**
  * Transform the parent
  *
  * @param \Puml\Model\Object $child  The direct child of the parent
  *
  * @return void
  * @since 0.1
  * @throws Exception
  */
 protected function transformParent(\Puml\Model\Object $child)
 {
     if (!$child->hasParent()) {
         throw new \Exception('Unable to transform parent, when no parent available, on class ' . $child->getName());
     }
     $this->level++;
     $parent = $child->getParent();
     $this->transformObject($parent);
     $edge = new Edge($this->graph->findNode($child->getName()), $this->graph->findNode($parent->getName()));
     $edge->setArrowhead('empty');
     $this->graph->link($edge);
     if ($parent->hasParent()) {
         $this->transformParent($parent);
     }
 }
예제 #2
0
 /**
  * @covers Puml\Model\Object::getParent
  */
 public function testGetParent()
 {
     $parent = $this->getMock(get_class($this->object));
     $this->object->setParent($parent);
     $this->assertSame($parent, $this->object->getParent());
 }