Ejemplo n.º 1
0
 public function testCRUD()
 {
     $entity = new Account();
     $entity->setName(self::NAME);
     $entity->setOwnerId(1);
     $this->dao->persist($entity);
     $this->assertEquals(self::ID, $entity->getId());
     $this->assertEquals(self::NAME, $entity->getName());
     $entity = $this->dao->findById(self::ID);
     $this->assertEquals(self::ID, $entity->getId());
     $this->assertEquals(self::NAME, $entity->getName());
     $entity->setName(self::NAME_ANOTHER);
     $entity = $this->dao->flush($entity);
     $entity = $this->dao->findById(self::ID);
     $this->assertEquals(self::ID, $entity->getId());
     $this->assertEquals(self::NAME_ANOTHER, $entity->getName());
     $this->dao->remove($entity);
     $this->assertNull($entity->getId());
     $this->assertNull($entity->getName());
 }
Ejemplo n.º 2
0
 public function entity(AccountDTO $dto, Account $entity)
 {
     $entity->setOwnerId($dto->getOwnerId());
     $entity->setIdParent($dto->getIdParent());
     $entity->setName($dto->getName());
 }