/**
  * @covers Kunstmaan\FormBundle\Entity\FormSubmission::getNode
  * @covers Kunstmaan\FormBundle\Entity\FormSubmission::setNode
  */
 public function testSetGetNode()
 {
     $object = $this->object;
     $node = new Node();
     $node->setId(123);
     $object->setNode($node);
     $retrievedNode = $object->getNode();
     $this->assertEquals($node, $retrievedNode);
     $this->assertEquals($node->getId(), $retrievedNode->getId());
 }
 /**
  * @param string $lang   The locale
  * @param string $title  The title
  * @param string $slug   The slug
  * @param int    $nodeId The node id
  *
  * @return Node
  */
 private function getNodeWithTranslation($lang, $title, $slug, $nodeId = null)
 {
     $node = new Node();
     if (!is_null($nodeId)) {
         $node->setId($nodeId);
     }
     $nodeTranslation = new NodeTranslation();
     $nodeTranslation->setLang($lang)->setTitle($title)->setSlug($slug);
     $node->addNodeTranslation($nodeTranslation);
     return $node;
 }
예제 #3
0
 /**
  * @covers Kunstmaan\NodeBundle\Entity\Node::__toString
  */
 public function testToString()
 {
     $this->object->setId(1);
     $this->object->setRef(new TestEntity());
     $this->assertEquals('node 1, refEntityName: Kunstmaan\\NodeBundle\\Tests\\Entity\\TestEntity', $this->object->__toString());
 }