Exemple #1
0
 /**
  * @covers Puml\Model\Object::hasMethod
  */
 public function testHasMethod()
 {
     $method = $this->getMock('\\Puml\\Model\\Method');
     $this->assertFalse($this->object->hasMethod($method));
     $this->object->addMethod($method);
     $this->assertTrue($this->object->hasMethod($method));
 }
Exemple #2
0
 /**
  * Transform the object to an UML scheme
  *
  * @param \Puml\Model\Object $object
  *
  * @return void
  * @since 0.1
  */
 protected function transformObject(\Puml\Model\Object $object)
 {
     $label = implode('|', array(addslashes($object->getName()), implode($this->transformProperties($object->getProperties())), implode($this->transformMethods($object->getMethods()))));
     $node = new Node($object->getName());
     $node->setShape('record')->setPos('0, ' . (0 + $this->level * 3) . '!')->setLabel('"{' . $label . '}"');
     $this->graph->setNode($node);
 }
Exemple #3
0
 /**
  * Determine the parent
  *
  * @param \ReflectionClass   $reflectedObject
  * @param \Puml\Model\Object $object
  *
  * @return void
  * @since 0.1
  */
 protected function determineParent(\ReflectionClass $reflectedObject, \Puml\Model\Object $object)
 {
     if ($reflectedObject->getParentClass() !== false) {
         $analyser = $this->create($reflectedObject->getParentClass()->getName());
         $analyser->run();
         $object->setParent($analyser->getObject());
     }
 }